]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
Convert exception handling to Python3 syntax.
[dak.git] / daklib / dbconn.py
index 1fa7974f5d0f5e2f2cdd4101c1621722bf86a731..4e01b610ce1789acffd9272d8559c34f86542795 100755 (executable)
@@ -81,6 +81,9 @@ import warnings
 warnings.filterwarnings('ignore', \
     "The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to 'postgresql'.*", \
     SADeprecationWarning)
+warnings.filterwarnings('ignore', \
+    "Predicate of partial index .* ignored during reflection", \
+    SAWarning)
 
 
 ################################################################################
@@ -815,7 +818,7 @@ class BuildQueue(object):
                     Logger.log(["I: Removing %s from the queue" % o.fullpath])
                     os.unlink(o.fullpath)
                     killdb = True
-            except OSError, e:
+            except OSError as e:
                 # If it wasn't there, don't worry
                 if e.errno == ENOENT:
                     killdb = True
@@ -3681,7 +3684,7 @@ class DBConn(object):
             self.__setuptables()
             self.__setupmappers()
 
-        except OperationalError, e:
+        except OperationalError as e:
             import utils
             utils.fubar("Cannot connect to database (%s)" % str(e))