Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6ac3311

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

1 file changed

+4-1Lines changed: 4 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/filelock.py‎

Copy file name to clipboardExpand all lines: bpython/filelock.py
+4-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.