diff options
author | Brian May <brian@linuxpenguins.xyz> | 2018-06-18 17:11:31 +1000 |
---|---|---|
committer | Brian May <brian@linuxpenguins.xyz> | 2018-07-13 15:15:20 +1000 |
commit | 2d387d61be46768882e534a9dd9bac9881f894fe (patch) | |
tree | 0b392efacaa97b2251e104c01e1e0a238373bf0f /bin/update-db | |
parent | 5e863c7edf518312320f467ecf72af3d7ed3de8e (diff) |
Update python exception syntax for Python 3.6 compatibility
Diffstat (limited to 'bin/update-db')
-rwxr-xr-x | bin/update-db | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/update-db b/bin/update-db index ca9735f0ab..1c61ce3928 100755 --- a/bin/update-db +++ b/bin/update-db @@ -14,7 +14,7 @@ def setup_paths(): return path idx = string.rfind(path, '/') if idx == -1: - raise ImportError, "could not setup paths" + raise ImportError("could not setup paths") path = path[0:idx] os.chdir(setup_paths()) @@ -38,16 +38,16 @@ cursor = db.writeTxn() try: warnings = db.readBugs(cursor, 'data') -except SyntaxError, e: +except SyntaxError as e: if e.filename is None or e.lineno is None: print "error:", e else: print "%s:%d: %s" % (e.filename, e.lineno, e.msg) sys.exit(1) -except debian_support.ParseError, e: +except debian_support.ParseError as e: e.printOut(sys.stderr) sys.exit(1) -except security_db.InsertError, e: +except security_db.InsertError as e: for err in e.errors: print err sys.exit(1) @@ -60,7 +60,7 @@ if warnings: try: db.readPackages(cursor, 'data/packages') -except debian_support.ParseError, e: +except debian_support.ParseError as e: e.printOut(sys.stderr) sys.exit(1) |