summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBrian May <brian@linuxpenguins.xyz>2018-06-18 17:11:31 +1000
committerBrian May <brian@linuxpenguins.xyz>2018-07-13 15:15:20 +1000
commitcc04ebb4f6ebbf80080b7990d710a55fd55a19a2 (patch)
treeea5ffabe533be6124b9c30bc82af3e23d08f10dc /bin
parent9889b3ebf70085d28f84371a931adcced2ff19fd (diff)
Update python exception syntax for Python 3.6 compatibility
Diffstat (limited to 'bin')
-rwxr-xr-xbin/apt-update-file2
-rwxr-xr-xbin/check-syntax4
-rwxr-xr-xbin/contact-maintainers2
-rwxr-xr-xbin/list-queue2
-rwxr-xr-xbin/update-db10
-rwxr-xr-xbin/update-nvd2
6 files changed, 11 insertions, 11 deletions
diff --git a/bin/apt-update-file b/bin/apt-update-file
index 2c4c71df86..6b253009db 100755
--- a/bin/apt-update-file
+++ b/bin/apt-update-file
@@ -15,7 +15,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]
root_path = setup_paths()
diff --git a/bin/check-syntax b/bin/check-syntax
index 115636f81f..adbe36ccd4 100755
--- a/bin/check-syntax
+++ b/bin/check-syntax
@@ -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]
root_path = setup_paths()
@@ -38,7 +38,7 @@ def do_parse(f):
% r.name)
errors = True
names[n] = r.name
- except debian_support.ParseError, e:
+ except debian_support.ParseError as e:
e.printOut(sys.stderr)
errors = True
if errors:
diff --git a/bin/contact-maintainers b/bin/contact-maintainers
index e04f172bfa..feb9148024 100755
--- a/bin/contact-maintainers
+++ b/bin/contact-maintainers
@@ -43,7 +43,7 @@ else:
try:
graph.parse('https://packages.qa.debian.org/{}/{}.rdf'
.format(re.match('((?:lib)?.)', pkg).group(1), pkg))
- except urllib2.HTTPError, exc:
+ except urllib2.HTTPError as exc:
if exc.code == 404:
raise ValueError("unknown package '{}'".format(pkg))
raise
diff --git a/bin/list-queue b/bin/list-queue
index 793f0aec9b..5375493d54 100755
--- a/bin/list-queue
+++ b/bin/list-queue
@@ -180,7 +180,7 @@ def updatechanges(db, ondisk):
try:
dist = changes["Distribution"]
debs = set(pkg["name"] for pkg in changes["Checksums-Sha1"])
- except KeyError, e:
+ except KeyError as e:
raise IOError("missing key in " + repr(path) + ": "
+ repr(e.args[0]))
indb[path] = stat + (dist, debs)
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)
diff --git a/bin/update-nvd b/bin/update-nvd
index fb564c4a9f..40e0f51bf9 100755
--- a/bin/update-nvd
+++ b/bin/update-nvd
@@ -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())

© 2014-2024 Faster IT GmbH | imprint | privacy policy