]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/drecurse.py
helpers: rename realpath to resolve_parent
[bup.git] / lib / bup / drecurse.py
index 6be7fa2ff38f8ff7bd6de1d87e9536372c9448fe..90b7f26de4bf6316230c68ed49304a5d73e8c927 100644 (file)
@@ -39,8 +39,8 @@ def _dirlist():
     for n in os.listdir('.'):
         try:
             st = xstat.lstat(n)
-        except OSError, e:
-            add_error(Exception('%s: %s' % (realpath(n), str(e))))
+        except OSError as e:
+            add_error(Exception('%s: %s' % (resolve_parent(n), str(e))))
             continue
         if (st.st_mode & _IFMT) == stat.S_IFDIR:
             n += '/'
@@ -70,7 +70,7 @@ def _recursive_dirlist(prepend, xdev, bup_dir=None,
             else:
                 try:
                     OsFile(name).fchdir()
-                except OSError, e:
+                except OSError as e:
                     add_error('%s: %s' % (prepend, e))
                 else:
                     for i in _recursive_dirlist(prepend=prepend+name, xdev=xdev,
@@ -93,12 +93,12 @@ def recursive_dirlist(paths, xdev, bup_dir=None, excluded_paths=None,
                 if stat.S_ISLNK(pst.st_mode):
                     yield (path, pst)
                     continue
-            except OSError, e:
+            except OSError as e:
                 add_error('recursive_dirlist: %s' % e)
                 continue
             try:
                 pfile = OsFile(path)
-            except OSError, e:
+            except OSError as e:
                 add_error(e)
                 continue
             pst = pfile.stat()