]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/compat.py
get: adjust for python 3 and test there
[bup.git] / lib / bup / compat.py
index 03041f35de9d08224edb18172137a87a2d69dd38..985d8ac4bd61be75e7d244b3a8536ddc3a592336 100644 (file)
@@ -25,7 +25,7 @@ if py3:
               file=sys.stderr)
         sys.exit(2)
 
-    from os import fsencode
+    from os import fsdecode, fsencode
     from shlex import quote
     input = input
     range = range
@@ -74,13 +74,19 @@ if py3:
         """Return the concatenated bytes or memoryview arguments as bytes."""
         return b''.join(items)
 
+    def getcwd():
+        return fsencode(os.getcwd())
+
 else:  # Python 2
 
+    def fsdecode(x):
+        return x
+
     def fsencode(x):
         return x
 
     from pipes import quote
-    from os import environ
+    from os import environ, getcwd
 
     from bup.py2raise import reraise