From: Torsten Werner Date: Wed, 24 Aug 2011 18:27:22 +0000 (+0200) Subject: Convert raise statement to Python 2.6. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=f7e8ab5cc1ef088763a6e0f2b0cdba9ec2b63c87;p=dak.git Convert raise statement to Python 2.6. Signed-off-by: Torsten Werner --- diff --git a/dak/dakdb/update1.py b/dak/dakdb/update1.py index ede12e56..21942765 100755 --- a/dak/dakdb/update1.py +++ b/dak/dakdb/update1.py @@ -66,4 +66,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to appy DM table updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to appy DM table updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update10.py b/dak/dakdb/update10.py index 52a5d0be..31c70d37 100755 --- a/dak/dakdb/update10.py +++ b/dak/dakdb/update10.py @@ -53,4 +53,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update11.py b/dak/dakdb/update11.py index 6569f8eb..17001d39 100755 --- a/dak/dakdb/update11.py +++ b/dak/dakdb/update11.py @@ -60,4 +60,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new comments update, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new comments update, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update12.py b/dak/dakdb/update12.py index 1141c599..21d44a45 100755 --- a/dak/dakdb/update12.py +++ b/dak/dakdb/update12.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new update 12, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new update 12, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update13.py b/dak/dakdb/update13.py index ddb79780..1696e759 100755 --- a/dak/dakdb/update13.py +++ b/dak/dakdb/update13.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new update 13, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new update 13, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update14.py b/dak/dakdb/update14.py index 44b061b1..575e5d23 100755 --- a/dak/dakdb/update14.py +++ b/dak/dakdb/update14.py @@ -50,4 +50,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new update 14, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new update 14, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update15.py b/dak/dakdb/update15.py index 3074ff09..7d6b52e7 100755 --- a/dak/dakdb/update15.py +++ b/dak/dakdb/update15.py @@ -81,4 +81,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply source format update 15, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply source format update 15, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update16.py b/dak/dakdb/update16.py index d64c2220..6cd6dc4b 100755 --- a/dak/dakdb/update16.py +++ b/dak/dakdb/update16.py @@ -175,4 +175,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply ACLs update (16), rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply ACLs update (16), rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update17.py b/dak/dakdb/update17.py index 8fc3bd05..493640eb 100755 --- a/dak/dakdb/update17.py +++ b/dak/dakdb/update17.py @@ -60,7 +60,7 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new update 17, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new update 17, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update18.py b/dak/dakdb/update18.py index eb8efa4a..bdf24108 100755 --- a/dak/dakdb/update18.py +++ b/dak/dakdb/update18.py @@ -153,4 +153,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply knownchanges update 18, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply knownchanges update 18, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update19.py b/dak/dakdb/update19.py index 5186ded6..61e60703 100755 --- a/dak/dakdb/update19.py +++ b/dak/dakdb/update19.py @@ -104,4 +104,4 @@ def do_update(self): except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply debversion update 19, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply debversion update 19, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update2.py b/dak/dakdb/update2.py index 9ad0da5d..0d9d3871 100755 --- a/dak/dakdb/update2.py +++ b/dak/dakdb/update2.py @@ -398,4 +398,4 @@ $$ except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update20.py b/dak/dakdb/update20.py index 70572fcb..c1424ab2 100755 --- a/dak/dakdb/update20.py +++ b/dak/dakdb/update20.py @@ -97,4 +97,4 @@ def do_update(self): except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply debversion update 20, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply debversion update 20, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update21.py b/dak/dakdb/update21.py index 2555e4c7..c91b6f14 100755 --- a/dak/dakdb/update21.py +++ b/dak/dakdb/update21.py @@ -126,4 +126,4 @@ def do_update(self): 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))) diff --git a/dak/dakdb/update22.py b/dak/dakdb/update22.py index 81f20037..5c852c67 100755 --- a/dak/dakdb/update22.py +++ b/dak/dakdb/update22.py @@ -237,4 +237,4 @@ def do_update(self): 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))) diff --git a/dak/dakdb/update23.py b/dak/dakdb/update23.py index 922322b3..4750c153 100755 --- a/dak/dakdb/update23.py +++ b/dak/dakdb/update23.py @@ -60,5 +60,5 @@ CREATE VIEW srcfiles_suite_component AS except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update24.py b/dak/dakdb/update24.py index 83047668..64deb96e 100755 --- a/dak/dakdb/update24.py +++ b/dak/dakdb/update24.py @@ -58,5 +58,5 @@ def do_update(self): except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update25.py b/dak/dakdb/update25.py index 3fc8c558..0ce8ab6e 100755 --- a/dak/dakdb/update25.py +++ b/dak/dakdb/update25.py @@ -185,5 +185,5 @@ CREATE VIEW obsolete_all_associations AS except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update26.py b/dak/dakdb/update26.py index 4329bc3a..358f2ae4 100755 --- a/dak/dakdb/update26.py +++ b/dak/dakdb/update26.py @@ -63,5 +63,5 @@ def do_update(self): except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update27.py b/dak/dakdb/update27.py index 7a492a3f..814e6015 100755 --- a/dak/dakdb/update27.py +++ b/dak/dakdb/update27.py @@ -76,5 +76,5 @@ CREATE OR REPLACE VIEW bin_associations_binaries AS except psycopg2.InternalError as msg: self.db.rollback() - raise DBUpdateError, "Database error, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Database error, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update28.py b/dak/dakdb/update28.py index c899831c..1455ee31 100755 --- a/dak/dakdb/update28.py +++ b/dak/dakdb/update28.py @@ -267,5 +267,5 @@ $$ LANGUAGE plpythonu VOLATILE;""") except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new update 28, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new update 28, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update29.py b/dak/dakdb/update29.py index 66600b63..c77d99da 100644 --- a/dak/dakdb/update29.py +++ b/dak/dakdb/update29.py @@ -49,4 +49,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update3.py b/dak/dakdb/update3.py index 1eab89f6..f7a4e502 100755 --- a/dak/dakdb/update3.py +++ b/dak/dakdb/update3.py @@ -51,4 +51,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to appy versioncmp removal, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to appy versioncmp removal, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update30.py b/dak/dakdb/update30.py index fe591614..f68c74a3 100644 --- a/dak/dakdb/update30.py +++ b/dak/dakdb/update30.py @@ -97,4 +97,4 @@ $$ LANGUAGE plpythonu VOLATILE SECURITY DEFINER; except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update31.py b/dak/dakdb/update31.py index dc4245cc..7209178b 100644 --- a/dak/dakdb/update31.py +++ b/dak/dakdb/update31.py @@ -96,5 +96,5 @@ $$ LANGUAGE plpythonu VOLATILE SECURITY DEFINER; except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new update 31, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new update 31, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update32.py b/dak/dakdb/update32.py index c0882fb1..59355c91 100755 --- a/dak/dakdb/update32.py +++ b/dak/dakdb/update32.py @@ -46,5 +46,5 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply build_queue update 32, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply build_queue update 32, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update33.py b/dak/dakdb/update33.py index d3867af3..5b0fe110 100644 --- a/dak/dakdb/update33.py +++ b/dak/dakdb/update33.py @@ -52,4 +52,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply build_queue update 33, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply build_queue update 33, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update34.py b/dak/dakdb/update34.py index 35351c24..03f15739 100644 --- a/dak/dakdb/update34.py +++ b/dak/dakdb/update34.py @@ -45,4 +45,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply build_queue update 34, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply build_queue update 34, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update35.py b/dak/dakdb/update35.py index cc289e41..41d56674 100644 --- a/dak/dakdb/update35.py +++ b/dak/dakdb/update35.py @@ -47,4 +47,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply build_queue update 35, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply build_queue update 35, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update36.py b/dak/dakdb/update36.py index c672d8d7..432e09f3 100644 --- a/dak/dakdb/update36.py +++ b/dak/dakdb/update36.py @@ -45,4 +45,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply build_queue update 36, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply build_queue update 36, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update37.py b/dak/dakdb/update37.py index 136f4649..7ab52e04 100755 --- a/dak/dakdb/update37.py +++ b/dak/dakdb/update37.py @@ -54,4 +54,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply table-colum update 37, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply table-colum update 37, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update38.py b/dak/dakdb/update38.py index 28a411ba..da3a1d65 100755 --- a/dak/dakdb/update38.py +++ b/dak/dakdb/update38.py @@ -53,4 +53,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply table-column update 38, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply table-column update 38, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update39.py b/dak/dakdb/update39.py index c97b4f06..c02b9629 100644 --- a/dak/dakdb/update39.py +++ b/dak/dakdb/update39.py @@ -44,4 +44,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply table-column update 39, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply table-column update 39, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update4.py b/dak/dakdb/update4.py index 169653fa..938522cc 100755 --- a/dak/dakdb/update4.py +++ b/dak/dakdb/update4.py @@ -66,4 +66,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply sanity to suite_architecture table, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply sanity to suite_architecture table, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update40.py b/dak/dakdb/update40.py index a13ec10b..e3bb89e0 100755 --- a/dak/dakdb/update40.py +++ b/dak/dakdb/update40.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 40, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 40, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update41.py b/dak/dakdb/update41.py index 5243cd67..65661d3c 100755 --- a/dak/dakdb/update41.py +++ b/dak/dakdb/update41.py @@ -63,4 +63,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 41, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 41, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update42.py b/dak/dakdb/update42.py index bfd4b1fc..3c51232c 100755 --- a/dak/dakdb/update42.py +++ b/dak/dakdb/update42.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply update 42, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply update 42, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update43.py b/dak/dakdb/update43.py index 38bc29a1..430cc358 100755 --- a/dak/dakdb/update43.py +++ b/dak/dakdb/update43.py @@ -48,4 +48,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply update 43, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply update 43, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update44.py b/dak/dakdb/update44.py index 1b4a5714..bce1fe7d 100755 --- a/dak/dakdb/update44.py +++ b/dak/dakdb/update44.py @@ -49,4 +49,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 44, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 44, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update45.py b/dak/dakdb/update45.py index 8de1e670..fe84c9be 100755 --- a/dak/dakdb/update45.py +++ b/dak/dakdb/update45.py @@ -50,4 +50,4 @@ CREATE TABLE extra_src_references ( except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply update 45, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply update 45, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update46.py b/dak/dakdb/update46.py index 55a382fa..109a887a 100755 --- a/dak/dakdb/update46.py +++ b/dak/dakdb/update46.py @@ -74,4 +74,4 @@ CREATE TABLE source_metadata ( except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply update 46, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply update 46, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update47.py b/dak/dakdb/update47.py index c93ffb84..a6626594 100755 --- a/dak/dakdb/update47.py +++ b/dak/dakdb/update47.py @@ -49,4 +49,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 47, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 47, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update48.py b/dak/dakdb/update48.py index 3bc0f893..63a8a0e6 100755 --- a/dak/dakdb/update48.py +++ b/dak/dakdb/update48.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 48, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 48, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update49.py b/dak/dakdb/update49.py index 44e1f9fc..720f8cf3 100755 --- a/dak/dakdb/update49.py +++ b/dak/dakdb/update49.py @@ -58,4 +58,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 49, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 49, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update5.py b/dak/dakdb/update5.py index 7c892a7a..a42e540c 100755 --- a/dak/dakdb/update5.py +++ b/dak/dakdb/update5.py @@ -48,4 +48,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to recreate bin_assoc_by_arch view, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to recreate bin_assoc_by_arch view, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update50.py b/dak/dakdb/update50.py index 568c33bc..09499877 100755 --- a/dak/dakdb/update50.py +++ b/dak/dakdb/update50.py @@ -44,4 +44,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 50, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 50, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update51.py b/dak/dakdb/update51.py index 02a8fc23..2d4c1a2c 100755 --- a/dak/dakdb/update51.py +++ b/dak/dakdb/update51.py @@ -55,4 +55,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 51, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 51, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update52.py b/dak/dakdb/update52.py index 938b3cea..aa7a10d1 100755 --- a/dak/dakdb/update52.py +++ b/dak/dakdb/update52.py @@ -63,4 +63,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 52, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 52, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update53.py b/dak/dakdb/update53.py index a2c8a0a3..92508257 100755 --- a/dak/dakdb/update53.py +++ b/dak/dakdb/update53.py @@ -52,4 +52,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 53, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 53, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update54.py b/dak/dakdb/update54.py index 3922f69b..c218cc67 100755 --- a/dak/dakdb/update54.py +++ b/dak/dakdb/update54.py @@ -49,4 +49,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 54, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 54, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update55.py b/dak/dakdb/update55.py index 8dfc4a58..9e152227 100755 --- a/dak/dakdb/update55.py +++ b/dak/dakdb/update55.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 55, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 55, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update56.py b/dak/dakdb/update56.py index 58ecc9f2..647f8c79 100755 --- a/dak/dakdb/update56.py +++ b/dak/dakdb/update56.py @@ -87,4 +87,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 56, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 56, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update57.py b/dak/dakdb/update57.py index 1b6ddc8a..db49db43 100755 --- a/dak/dakdb/update57.py +++ b/dak/dakdb/update57.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 57, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 57, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update58.py b/dak/dakdb/update58.py index 802a5167..9f10d31b 100755 --- a/dak/dakdb/update58.py +++ b/dak/dakdb/update58.py @@ -87,4 +87,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 58, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 58, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update59.py b/dak/dakdb/update59.py index ec3f07f8..fd6fea55 100755 --- a/dak/dakdb/update59.py +++ b/dak/dakdb/update59.py @@ -53,4 +53,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 59, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 59, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update6.py b/dak/dakdb/update6.py index 78a04f5f..f3d11bbc 100755 --- a/dak/dakdb/update6.py +++ b/dak/dakdb/update6.py @@ -89,4 +89,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update60.py b/dak/dakdb/update60.py index dc61eaca..01735296 100755 --- a/dak/dakdb/update60.py +++ b/dak/dakdb/update60.py @@ -53,4 +53,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 60, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 60, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update61.py b/dak/dakdb/update61.py index d8b47ec8..3b18e0b3 100755 --- a/dak/dakdb/update61.py +++ b/dak/dakdb/update61.py @@ -52,4 +52,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 61, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 61, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update62.py b/dak/dakdb/update62.py index 597a19cb..7a47dca8 100755 --- a/dak/dakdb/update62.py +++ b/dak/dakdb/update62.py @@ -44,4 +44,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 62, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 62, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update63.py b/dak/dakdb/update63.py index 9d2cce68..e9e5c0f1 100755 --- a/dak/dakdb/update63.py +++ b/dak/dakdb/update63.py @@ -56,4 +56,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 63, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 63, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update64.py b/dak/dakdb/update64.py index b34a8787..49ca75a8 100755 --- a/dak/dakdb/update64.py +++ b/dak/dakdb/update64.py @@ -46,4 +46,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 64, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 64, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update65.py b/dak/dakdb/update65.py index 76bfe61a..46730b5f 100755 --- a/dak/dakdb/update65.py +++ b/dak/dakdb/update65.py @@ -48,4 +48,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 65, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 65, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update66.py b/dak/dakdb/update66.py index 2a59c713..d59306fa 100755 --- a/dak/dakdb/update66.py +++ b/dak/dakdb/update66.py @@ -57,4 +57,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, 'Unable to apply sick update 66, rollback issued. Error message : %s' % (str(msg)) + raise DBUpdateError('Unable to apply sick update 66, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/dakdb/update7.py b/dak/dakdb/update7.py index 7e5c2091..9c3dd1ed 100755 --- a/dak/dakdb/update7.py +++ b/dak/dakdb/update7.py @@ -118,4 +118,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to appy suite config updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to appy suite config updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update8.py b/dak/dakdb/update8.py index 1c86c866..98e0f088 100755 --- a/dak/dakdb/update8.py +++ b/dak/dakdb/update8.py @@ -101,4 +101,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/dakdb/update9.py b/dak/dakdb/update9.py index 20af71fd..bbdd2122 100755 --- a/dak/dakdb/update9.py +++ b/dak/dakdb/update9.py @@ -59,4 +59,4 @@ def do_update(self): except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))) diff --git a/dak/generate_index_diffs.py b/dak/generate_index_diffs.py index 75142ca7..3297c42c 100755 --- a/dak/generate_index_diffs.py +++ b/dak/generate_index_diffs.py @@ -81,7 +81,7 @@ def smartlink(f, t): os.system("bzip2 -d < %s.bz2 > %s" % (f, t)) else: print "missing: %s" % (f) - raise IOError, f + raise IOError(f) def smartopen(file): if os.path.isfile(file): diff --git a/dak/process_new.py b/dak/process_new.py index 905d2084..1c2231a3 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -639,7 +639,7 @@ def lock_package(package): except OSError as e: if e.errno == errno.EEXIST or e.errno == errno.EACCES: user = pwd.getpwuid(os.stat(path)[stat.ST_UID])[4].split(',')[0].replace('.', '') - raise AlreadyLockedError, user + raise AlreadyLockedError(user) try: yield fd diff --git a/dak/transitions.py b/dak/transitions.py index a5b8fa35..a5eb6b6c 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -297,7 +297,7 @@ def write_transitions_from_file(from_file): else: trans = load_transitions(from_file) if trans is None: - raise TransitionsError, "Unparsable transitions file %s" % (file) + raise TransitionsError("Unparsable transitions file %s" % (file)) write_transitions(trans) ################################################################################ diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 4e01b610..38001492 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2824,9 +2824,9 @@ def add_deb_to_db(u, filename, session=None): # Find source id bin_sources = get_sources_from_name(entry["source package"], entry["source version"], session=session) if len(bin_sources) != 1: - raise NoSourceFieldError, "Unable to find a unique source id for %s (%s), %s, file %s, type %s, signed by %s" % \ + raise NoSourceFieldError("Unable to find a unique source id for %s (%s), %s, file %s, type %s, signed by %s" % \ (bin.package, bin.version, entry["architecture"], - filename, bin.binarytype, u.pkg.changes["fingerprint"]) + filename, bin.binarytype, u.pkg.changes["fingerprint"])) bin.source_id = bin_sources[0].source_id @@ -2834,9 +2834,9 @@ def add_deb_to_db(u, filename, session=None): for srcname, version in entry["built-using"]: exsources = get_sources_from_name(srcname, version, session=session) if len(exsources) != 1: - raise NoSourceFieldError, "Unable to find source package (%s = %s) in Built-Using for %s (%s), %s, file %s, type %s, signed by %s" % \ + raise NoSourceFieldError("Unable to find source package (%s = %s) in Built-Using for %s (%s), %s, file %s, type %s, signed by %s" % \ (srcname, version, bin.package, bin.version, entry["architecture"], - filename, bin.binarytype, u.pkg.changes["fingerprint"]) + filename, bin.binarytype, u.pkg.changes["fingerprint"])) bin.extra_sources.append(exsources[0]) diff --git a/daklib/formats.py b/daklib/formats.py index edc80533..bcd42f61 100755 --- a/daklib/formats.py +++ b/daklib/formats.py @@ -58,7 +58,7 @@ def parse_format(txt): format = re_verwithext.search(txt) if format is None: - raise UnknownFormatError, txt + raise UnknownFormatError(txt) format = format.groups() @@ -80,7 +80,7 @@ def validate_changes_format(format, field): """ if (format < (1, 5) or format > (1, 8)): - raise UnknownFormatError, repr(format) + raise UnknownFormatError(repr(format)) if field != 'files' and format < (1, 8): - raise UnknownFormatError, repr(format) + raise UnknownFormatError(repr(format)) diff --git a/daklib/srcformats.py b/daklib/srcformats.py index 85ac701f..050691fe 100755 --- a/daklib/srcformats.py +++ b/daklib/srcformats.py @@ -48,7 +48,7 @@ def get_format_from_string(txt): if format.re_format.match(txt): return format - raise UnknownFormatError, "Unknown format %r" % txt + raise UnknownFormatError("Unknown format %r" % txt) class SourceFormat(type): def __new__(cls, name, bases, attrs): diff --git a/daklib/textutils.py b/daklib/textutils.py index 3cbcec73..03df5d85 100644 --- a/daklib/textutils.py +++ b/daklib/textutils.py @@ -88,7 +88,7 @@ def fix_maintainer(maintainer): else: m = re_parse_maintainer.match(maintainer) if not m: - raise ParseMaintError, "Doesn't parse as a valid Maintainer field." + raise ParseMaintError("Doesn't parse as a valid Maintainer field.") name = m.group(1) email = m.group(2) @@ -106,7 +106,7 @@ def fix_maintainer(maintainer): rfc2047_maint = "%s <%s>" % (rfc2047_name, email) if email.find("@") == -1 and email.find("buildd_") != 0: - raise ParseMaintError, "No @ found in email address part." + raise ParseMaintError("No @ found in email address part.") return (rfc822_maint, rfc2047_maint, name, email) diff --git a/daklib/utils.py b/daklib/utils.py index 6f352cd0..40e47c63 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -115,7 +115,7 @@ def open_file(filename, mode='r'): try: f = open(filename, mode) except IOError: - raise CantOpenError, filename + raise CantOpenError(filename) return f ################################################################################ @@ -172,7 +172,7 @@ def parse_deb822(armored_contents, signing_rules=0, keyrings=None, session=None) lines = contents.splitlines(True) if len(lines) == 0: - raise ParseChangesError, "[Empty changes file]" + raise ParseChangesError("[Empty changes file]") # Reindex by line number so we can easily verify the format of # .dsc files... @@ -190,7 +190,7 @@ def parse_deb822(armored_contents, signing_rules=0, keyrings=None, session=None) line = indexed_lines[index] if line == "" and signing_rules == 1: if index != num_of_lines: - raise InvalidDscError, index + raise InvalidDscError(index) break slf = re_single_line_field.match(line) if slf: @@ -204,7 +204,7 @@ def parse_deb822(armored_contents, signing_rules=0, keyrings=None, session=None) mlf = re_multi_line_field.match(line) if mlf: if first == -1: - raise ParseChangesError, "'%s'\n [Multi-line field continuing on from nothing?]" % (line) + raise ParseChangesError("'%s'\n [Multi-line field continuing on from nothing?]" % (line)) if first == 1 and changes[field] != "": changes[field] += '\n' first = 0 @@ -223,7 +223,7 @@ def parse_deb822(armored_contents, signing_rules=0, keyrings=None, session=None) changes["source-version"] = srcver.group(2) if error: - raise ParseChangesError, error + raise ParseChangesError(error) return changes @@ -257,7 +257,7 @@ def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None): try: unicode(content, 'utf-8') except UnicodeError: - raise ChangesUnicodeError, "Changes file not proper utf-8" + raise ChangesUnicodeError("Changes file not proper utf-8") changes = parse_deb822(content, signing_rules, keyrings=keyrings) @@ -272,7 +272,7 @@ def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None): missingfields.append(keyword) if len(missingfields): - raise ParseChangesError, "Missing mandantory field(s) in changes file (policy 5.5): %s" % (missingfields) + raise ParseChangesError("Missing mandantory field(s) in changes file (policy 5.5): %s" % (missingfields)) return changes @@ -559,7 +559,7 @@ def build_file_list(changes, is_a_dsc=0, field="files", hashname="md5sum"): else: (md5, size, name) = s except ValueError: - raise ParseChangesError, i + raise ParseChangesError(i) if section == "": section = "-" @@ -694,7 +694,7 @@ def send_mail (message, filename=""): # Invoke sendmail (result, output) = commands.getstatusoutput("%s < %s" % (Cnf["Dinstall::SendmailCommand"], filename)) if (result != 0): - raise SendmailFailedError, output + raise SendmailFailedError(output) # Clean up any temporary files if message: