File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 4242import os
4343
4444if os .name == 'nt' :
45- import win32con
4645 import win32file
4746 import pywintypes
48- LOCK_EX = win32con . LOCKFILE_EXCLUSIVE_LOCK
49- LOCK_SH = 0 # the default
50- LOCK_NB = win32con . LOCKFILE_FAIL_IMMEDIATELY
47+ LOCK_SH = 0 # the default
48+ LOCK_NB = 0x1 # LOCKFILE_FAIL_IMMEDIATELY
49+ LOCK_EX = 0x2 # LOCKFILE_EXCLUSIVE_LOCK
5150 # is there any reason not to reuse the following structure?
5251 __overlapped = pywintypes .OVERLAPPED ()
5352elif os .name == 'posix' :
5453 import fcntl
54+ LOCK_SH = fcntl .LOCK_SH # shared lock
55+ LOCK_NB = fcntl .LOCK_NB # non-blocking
5556 LOCK_EX = fcntl .LOCK_EX
56- LOCK_SH = fcntl .LOCK_SH
57- LOCK_NB = fcntl .LOCK_NB
5857else :
5958 raise RuntimeError ("PortaLocker only defined for nt and posix platforms" )
6059
You can’t perform that action at this time.
0 commit comments