File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 4444if os .name == 'nt' :
4545 import win32file
4646 import pywintypes
47+ import msvcrt
4748 LOCK_SH = 0 # the default
4849 LOCK_NB = 0x1 # LOCKFILE_FAIL_IMMEDIATELY
4950 LOCK_EX = 0x2 # LOCKFILE_EXCLUSIVE_LOCK
6162 # eugh, we want 0xffff0000 here, but python 2.3 won't let us :(
6263 FFFF0000 = - 65536
6364 def lock (file , flags ):
64- hfile = win32file . _get_osfhandle (file .fileno ())
65+ hfile = msvcrt . get_osfhandle (file .fileno ())
6566 # LockFileEx is not supported on all Win32 platforms (Win95, Win98,
6667 # WinME).
6768 # If it's not supported, win32file will raise an exception.
@@ -104,7 +105,7 @@ def lock(file, flags):
104105 # TODO: should this return the result of the lock?
105106
106107 def unlock (file ):
107- hfile = win32file . _get_osfhandle (file .fileno ())
108+ hfile = msvcrt . get_osfhandle (file .fileno ())
108109 # UnlockFileEx is not supported on all Win32 platforms (Win95, Win98,
109110 # WinME).
110111 # If it's not supported, win32file will raise an api_error exception.
You can’t perform that action at this time.
0 commit comments