]> arthur.barton.de Git - bup.git/commitdiff
Replace a try/except/finally with a nested try block.
authorMichael Budde <mbudde@gmail.com>
Sat, 4 Dec 2010 13:49:08 +0000 (05:49 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Sat, 4 Dec 2010 13:49:08 +0000 (05:49 -0800)
try/except/finally doesn't work in python 2.4.

lib/bup/drecurse.py

index 6da052321beb745a886f803aa279fbdcd058dd98..de180bc5af75d65aae2538e893b6d4f72c4d7714 100644 (file)
@@ -123,11 +123,12 @@ def parse_excludes(flags):
 
         if option == '--exclude-from':
             try:
-                f = open(realpath(parameter))
-                for exclude_path in f.readlines():
-                    excluded_paths.append(realpath(exclude_path.strip()))
-            except Error, e:
-                log("warning: couldn't read %s" % parameter)
+                try:
+                    f = open(realpath(parameter))
+                    for exclude_path in f.readlines():
+                        excluded_paths.append(realpath(exclude_path.strip()))
+                except Error, e:
+                    log("warning: couldn't read %s" % parameter)
             finally:
                 f.close()