Bläddra i källkod

Fix py3.2 specific EDEADLK related bug.

Jonas Borgström 11 år sedan
förälder
incheckning
9178d76ce7
2 ändrade filer med 3 tillägg och 1 borttagningar
  1. 1 0
      CHANGES
  2. 2 1
      attic/helpers.py

+ 1 - 0
CHANGES

@@ -16,6 +16,7 @@ Version 0.13
 - Added cachedir support. CACHEDIR.TAG compatible cache directories
 - Added cachedir support. CACHEDIR.TAG compatible cache directories
   can now be excluded using ``--exclude-caches`` (#74)
   can now be excluded using ``--exclude-caches`` (#74)
 - Fix crash on extreme mtime timestamps (year 2400+) (#81)
 - Fix crash on extreme mtime timestamps (year 2400+) (#81)
+- Fix Python 3.2 specific lockf issue (EDEADLK)
 
 
 Version 0.12
 Version 0.12
 ------------
 ------------

+ 2 - 1
attic/helpers.py

@@ -51,7 +51,8 @@ class UpgradableLock:
     def upgrade(self):
     def upgrade(self):
         try:
         try:
             fcntl.lockf(self.fd, fcntl.LOCK_EX)
             fcntl.lockf(self.fd, fcntl.LOCK_EX)
-        except OSError as e:
+        # Python 3.2 raises IOError, Python3.3+ raises OSError
+        except (OSError):
             raise self.LockUpgradeFailed(self.path)
             raise self.LockUpgradeFailed(self.path)
         self.is_exclusive = True
         self.is_exclusive = True