summaryrefslogtreecommitdiffstats
path: root/lib/python/debian_support.py
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
commit2d387d61be46768882e534a9dd9bac9881f894fe (patch)
tree0b392efacaa97b2251e104c01e1e0a238373bf0f /lib/python/debian_support.py
parent5e863c7edf518312320f467ecf72af3d7ed3de8e (diff)
Update python exception syntax for Python 3.6 compatibility
Diffstat (limited to 'lib/python/debian_support.py')
-rw-r--r--lib/python/debian_support.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/python/debian_support.py b/lib/python/debian_support.py
index fb44bc5771..717705dcd2 100644
--- a/lib/python/debian_support.py
+++ b/lib/python/debian_support.py
@@ -60,9 +60,9 @@ class ParseError(Exception):
return self.msg
def __repr__(self):
- return "ParseError(%s, %d, %s)" % (`self.filename`,
+ return "ParseError(%s, %d, %s)" % (repr(self.filename),
self.lineno,
- `self.msg`)
+ repr(self.msg))
def printOut(self, file):
"""Writes a machine-parsable error message to file."""
@@ -231,7 +231,7 @@ def patchesFromEdScript(source,
for line in i:
match = re_cmd.match(line)
if match is None:
- raise ValueError, "invalid patch command: " + `line`
+ raise ValueError("invalid patch command: " + repr(line))
(first, last, cmd) = match.groups()
first = int(first)
@@ -247,7 +247,7 @@ def patchesFromEdScript(source,
if cmd == 'a':
if last is not None:
- raise ValueError, "invalid patch argument: " + `line`
+ raise ValueError("invalid patch argument: " + repr(line))
last = first
else: # cmd == c
first = first - 1
@@ -257,7 +257,7 @@ def patchesFromEdScript(source,
lines = []
for l in i:
if l == '':
- raise ValueError, "end of stream in command: " + `line`
+ raise ValueError("end of stream in command: " + repr(line))
if l == '.\n' or l == '.':
break
lines.append(l)
@@ -392,7 +392,7 @@ def updateFile(remote, local, verbose=None):
try:
patch_contents = downloadGunzipLines(remote + '.diff/' + patch_name
+ '.gz')
- except IOError, e:
+ except IOError:
return downloadFile(remote, local)
if readLinesSHA1(patch_contents ) <> patch_hashes[patch_name]:
if verbose:
@@ -449,7 +449,7 @@ class BinaryPackage(object):
if match is None:
raise SyntaxError(('package %s references '
+ 'invalid source package %s') %
- (pkg_name, `contents`))
+ (pkg_name, repr(contents)))
(pkg_source, pkg_source_version) = match.groups()
elif name == "architecture":
pkg_arch = contents

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