Skip to content

Commit 6ac3311

Browse files
committed
Change default to None and set it to LOCK_EX in __init__ (fixes #509)
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at> (cherry picked from commit e83fb4a)
1 parent 40eb018 commit 6ac3311

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bpython/filelock.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ class FileLock(object):
3636
On platforms without fcntl, all operations in this class are no-ops.
3737
"""
3838

39-
def __init__(self, fd, mode=fcntl.LOCK_EX):
39+
def __init__(self, fd, mode=None):
40+
if has_fcntl and mode is None:
41+
mode = fcntl.LOCK_EX
42+
4043
self.fd = fd
4144
self.mode = mode
4245

0 commit comments

Comments
 (0)