Skip to content

Commit 82f5a2d

Browse files
Support fcntl check on Emscripten (#398)
* Support fcntl check on Emscripten * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix `fcntl.flock` typo --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 468ba43 commit 82f5a2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/filelock/_unix.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def _release(self) -> None:
2626
else: # pragma: win32 no cover
2727
try:
2828
import fcntl
29-
except ImportError:
29+
30+
_ = (fcntl.flock, fcntl.LOCK_EX, fcntl.LOCK_NB, fcntl.LOCK_UN)
31+
except (ImportError, AttributeError):
3032
pass
3133
else:
3234
has_fcntl = True

0 commit comments

Comments
 (0)