Skip to content

Commit 26b4d7c

Browse files
authored
Restore 'if TYPE_CHECKING' syntax for FileLock definition (#245)
1 parent 64034a2 commit 26b4d7c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/filelock/__init__.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
if warnings is not None:
3333
warnings.warn("only soft file lock is available", stacklevel=2)
3434

35-
36-
#: Alias for the lock, which should be used for the current platform.
37-
FileLock: type[BaseFileLock] = SoftFileLock if TYPE_CHECKING else _FileLock # type: ignore[assignment]
35+
if TYPE_CHECKING: # noqa: SIM108
36+
FileLock = SoftFileLock
37+
else:
38+
#: Alias for the lock, which should be used for the current platform.
39+
FileLock = _FileLock
3840

3941

4042
__all__ = [

0 commit comments

Comments
 (0)