Rev 2365: Don't create the alternative lock types unless we are on windows. in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/lock_cleanup
John Arbash Meinel
john at arbash-meinel.com
Wed Mar 14 23:13:55 GMT 2007
At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/lock_cleanup
------------------------------------------------------------
revno: 2365
revision-id: john at arbash-meinel.com-20070314231341-itctu2g4nobeexu4
parent: john at arbash-meinel.com-20070314205703-taih3n87g9n4afdv
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: lock_cleanup
timestamp: Wed 2007-03-14 18:13:41 -0500
message:
Don't create the alternative lock types unless we are on windows.
modified:
bzrlib/lock.py lock.py-20050527050856-ec090bb51bc03349
-------------- next part --------------
=== modified file 'bzrlib/lock.py'
--- a/bzrlib/lock.py 2007-03-14 20:57:03 +0000
+++ b/bzrlib/lock.py 2007-03-14 23:13:41 +0000
@@ -35,6 +35,7 @@
"""
import errno
+import sys
from bzrlib import (
errors,
@@ -170,7 +171,7 @@
_lock_classes.append(('fcntl', _fcntl_WriteLock, _fcntl_ReadLock))
-if have_pywin32:
+if have_pywin32 and sys.platform == 'win32':
LOCK_SH = 0 # the default
LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
@@ -220,7 +221,7 @@
_lock_classes.append(('pywin32', _w32c_WriteLock, _w32c_ReadLock))
-if have_ctypes:
+if have_ctypes and sys.platform == 'win32':
# These constants were copied from the win32con.py module.
LOCKFILE_FAIL_IMMEDIATELY = 1
LOCKFILE_EXCLUSIVE_LOCK = 2
More information about the bazaar-commits
mailing list