]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/drecurse.py
lib/bup/drecurse.py: work even if O_NOFOLLOW is missing.
[bup.git] / lib / bup / drecurse.py
index de180bc5af75d65aae2538e893b6d4f72c4d7714..4196dec0faabb6377db279892c956cf0cb437826 100644 (file)
@@ -5,6 +5,10 @@ try:
     O_LARGEFILE = os.O_LARGEFILE
 except AttributeError:
     O_LARGEFILE = 0
+try:
+    O_NOFOLLOW = os.O_NOFOLLOW
+except AttributeError:
+    O_NOFOLLOW = 0
 
 
 # the use of fchdir() and lstat() is for two reasons:
@@ -13,8 +17,7 @@ except AttributeError:
 class OsFile:
     def __init__(self, path):
         self.fd = None
-        self.fd = os.open(path, 
-                          os.O_RDONLY|O_LARGEFILE|os.O_NOFOLLOW|os.O_NDELAY)
+        self.fd = os.open(path, os.O_RDONLY|O_LARGEFILE|O_NOFOLLOW|os.O_NDELAY)
         
     def __del__(self):
         if self.fd: