]> git.decadent.org.uk Git - dak.git/blobdiff - dak/dakdb/update29.py
Convert exception handling to Python3 syntax.
[dak.git] / dak / dakdb / update29.py
index 5df1ad810091f4ef09981101da7094e4e8d46cbb..66600b6312915d4ea6816205f37dcc06de478e22 100644 (file)
@@ -38,12 +38,7 @@ def do_update(self):
 
     try:
         c = self.db.cursor()
-        c.execute("""DROP AGGREGATE comma_separated_list(                   BASETYPE = text,
-                   SFUNC = comma_concat,
-                   STYPE = text,
-                   INITCOND = ''
-);""" )
-        c.execute("""DROP FUNCTION comma_concat(text, text);""" );
+        c.execute("""DROP FUNCTION comma_concat(text, text) CASCADE;""" );
         c.execute("""DROP TABLE pending_content_associations;""")
         c.execute("""DROP TABLE content_associations;""")
         c.execute("""DROP TABLE content_file_names;""")
@@ -52,6 +47,6 @@ def do_update(self):
         c.execute("UPDATE config SET value = '29' WHERE name = 'db_revision'")
         self.db.commit()
 
-    except psycopg2.ProgrammingError, msg:
+    except psycopg2.ProgrammingError as msg:
         self.db.rollback()
         raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))