X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fupdate_db.py;h=dfa7ef78b12fefb2f767912fba4eae7d16a0f3c2;hb=1c2f5f4048b36efb345a3aa96b20d60dc7af1990;hp=89fc174ecd0f2857be05a0b3ded4fcc2400acc00;hpb=4c6d9d52eddb26028e5328e30c2d312bc45f3906;p=dak.git diff --git a/dak/update_db.py b/dak/update_db.py index 89fc174e..dfa7ef78 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -134,7 +134,7 @@ Updates dak's database schema to the lastest version. You should disable crontab self.db = psycopg2.connect(connect_str) - except Exception, e: + except Exception as e: print "FATAL: Failed connect to database (%s)" % str(e) sys.exit(1) @@ -171,7 +171,7 @@ Updates dak's database schema to the lastest version. You should disable crontab message = "updated database schema from %d to %d" % (database_revision, i+1) print message logger.log([message]) - except DBUpdateError, e: + except DBUpdateError as e: # Seems the update did not work. print "Was unable to update database schema from %d to %d." % (database_revision, i+1) print "The error message received was %s" % (e) @@ -205,7 +205,7 @@ Updates dak's database schema to the lastest version. You should disable crontab fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) else: utils.warn("Lock directory doesn't exist yet - not locking") - except IOError, e: + except IOError as e: if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EAGAIN': utils.fubar("Couldn't obtain lock; assuming another 'dak process-unchecked' is already running.")