]> arthur.barton.de Git - bup.git/commitdiff
vfs: accommodate py3 exception module removal
authorRob Browning <rlb@defaultvalue.org>
Tue, 10 Sep 2019 06:19:26 +0000 (01:19 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 29 Sep 2019 20:25:18 +0000 (15:25 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/vfs.py

index 3ab0e044f5623c5085736dfef6b60b192f368b0e..8a1e671df73b2aa3f809e34ed07f9c98e7d18881 100644 (file)
@@ -53,7 +53,7 @@ from itertools import chain, dropwhile, groupby, tee
 from random import randrange
 from stat import S_IFDIR, S_IFLNK, S_IFREG, S_ISDIR, S_ISLNK, S_ISREG
 from time import localtime, strftime
-import exceptions, re, sys
+import re, sys
 
 from bup import git, metadata, vint
 from bup.compat import range
@@ -64,12 +64,17 @@ from bup.vint import read_bvec, write_bvec
 from bup.vint import read_vint, write_vint
 from bup.vint import read_vuint, write_vuint
 
+if sys.version_info[0] < 3:
+    from exceptions import IOError as py_IOError
+else:
+    py_IOError = IOError
+
 # We currently assume that it's always appropriate to just forward IOErrors
 # to a remote client.
 
-class IOError(exceptions.IOError):
+class IOError(py_IOError):
     def __init__(self, errno, message, terminus=None):
-        exceptions.IOError.__init__(self, errno, message)
+        py_IOError.__init__(self, errno, message)
         self.terminus = terminus
 
 def write_ioerror(port, ex):