Skip to content

Commit e83fb4a

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>
1 parent d2287ad commit e83fb4a

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy