]> arthur.barton.de Git - bup.git/commitdiff
lib/bup/vfs: bring back Python 2.4 support
authorGabriel Filion <lelutin@gmail.com>
Fri, 20 Aug 2010 06:24:57 +0000 (02:24 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 22 Aug 2010 06:40:31 +0000 (23:40 -0700)
There is currently one test failure when running tests against Python
2.4: a try..except..finally block that's interpreted as a syntax error.
The commit introducing this incompatibility with 2.4 is f77a0829

This is a well known python 2.4 limitation and the workaround, although
ugly, is easy.

With this test passing, Python 2.4 support is back.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
lib/bup/vfs.py

index 7d04a8c426beb81c914b79ea4900fe2aa0baf092..1e61745ee8da6048afdd2241e4caa070665c8452 100644 (file)
@@ -346,11 +346,12 @@ class Symlink(File):
                                   % self.fullname())
         _symrefs += 1
         try:
-            return self.parent.lresolve(self.readlink(),
-                                        stay_inside_fs=True)
-        except NoSuchFile:
-            raise NoSuchFile("%s: broken symlink to %r"
-                             % (self.fullname(), self.readlink()))
+            try:
+                return self.parent.lresolve(self.readlink(),
+                                            stay_inside_fs=True)
+            except NoSuchFile:
+                raise NoSuchFile("%s: broken symlink to %r"
+                                 % (self.fullname(), self.readlink()))
         finally:
             _symrefs -= 1