Skip to content

Commit

Permalink
Restore 'if TYPE_CHECKING' syntax for FileLock definition (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlax committed Jun 12, 2023
1 parent 64034a2 commit 26b4d7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/filelock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
if warnings is not None:
warnings.warn("only soft file lock is available", stacklevel=2)


#: Alias for the lock, which should be used for the current platform.
FileLock: type[BaseFileLock] = SoftFileLock if TYPE_CHECKING else _FileLock # type: ignore[assignment]
if TYPE_CHECKING: # noqa: SIM108
FileLock = SoftFileLock
else:
#: Alias for the lock, which should be used for the current platform.
FileLock = _FileLock


__all__ = [
Expand Down

0 comments on commit 26b4d7c

Please sign in to comment.