X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate21.py;h=c91b6f1410e4cd486fd6fd4737a84d710326bd45;hb=e2c4fd7f21c3b33cd7192bded5d6373e0ee90374;hp=8e36883f9eb7b4cdf9bfc80a322d9044fec64346;hpb=6d0c1b149473118c7efa7384a9f41fdf1428ffaf;p=dak.git diff --git a/dak/dakdb/update21.py b/dak/dakdb/update21.py index 8e36883f..c91b6f14 100755 --- a/dak/dakdb/update21.py +++ b/dak/dakdb/update21.py @@ -74,7 +74,7 @@ def do_update(self): f = c.fetchone() c.execute("""INSERT INTO queue_files (queueid, lastused, filename, fileid) VALUES (%s, now(), %s, %s)""", (queue, filename[filename.rindex('/')+1:], f[0])) - except OSError, e: + except OSError as e: print "Can't find file %s (%s)" % (filename, e) print "Dropping old queue_build table" @@ -124,6 +124,6 @@ def do_update(self): c.execute("UPDATE config SET value = '21' WHERE name = 'db_revision'") self.db.commit() - except psycopg2.InternalError, msg: + except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg)))