diff options
author | Brian May <brian@linuxpenguins.xyz> | 2018-07-15 09:37:12 +1000 |
---|---|---|
committer | Brian May <brian@linuxpenguins.xyz> | 2018-08-06 16:57:35 +1000 |
commit | 03df6d7ffc27bf1ea31e5203b6534ed5ab6a6e91 (patch) | |
tree | ca2914c3f3779b2f6fe205911b3f2e3149ae62ad /bin/mass-bug-filer | |
parent | aabfc8b9a152230ccabf0cffd8b824a9fe2ca3a7 (diff) |
Fix print statements for Python 3.6 compatibility
Diffstat (limited to 'bin/mass-bug-filer')
-rwxr-xr-x | bin/mass-bug-filer | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/mass-bug-filer b/bin/mass-bug-filer index 5987b12f7f..ce2477e0d2 100755 --- a/bin/mass-bug-filer +++ b/bin/mass-bug-filer @@ -1,4 +1,5 @@ #!/usr/bin/python +from __future__ import print_function import sys import apt @@ -7,7 +8,7 @@ import os import re if len(sys.argv) < 3: - print >>sys.stderr, "usage: %s FILE PACKAGE..." % sys.argv[0] + print("usage: %s FILE PACKAGE..." % sys.argv[0], file=sys.stderr) sys.exit(1) message_file = file(sys.argv[1]) @@ -17,7 +18,7 @@ cache = apt.Cache() errors = False for p in packages: if not cache.has_key(p): - print >>sys.stderr, "error: no such package:", p + print("error: no such package:", p, file=sys.stderr) errors = True if errors: sys.exit(2) @@ -37,7 +38,7 @@ for line in source_lines: if line == '\n': if h_subject is None: - print >>sys.stderr, "error: missing Subject header" + print("error: missing Subject header", file=sys.stderr) sys.exit(2) state = 1 continue @@ -45,7 +46,7 @@ for line in source_lines: # state == 0 match = re_header.match(line) if match is None: - print >>sys.stderr, "error: invalid line:", line + print("error: invalid line:", line, file=sys.stderr) sys.exit(2) (k, v) = match.groups() if k == "Subject": @@ -54,7 +55,7 @@ for line in source_lines: if h_bug.has_key(k): h_bug[k] = v continue - print >>sys.stderr, "error: invalid header field:", k + print("error: invalid header field:", k, file=sys.stderr) sys.exit(2) def make_message(pkg): @@ -79,7 +80,7 @@ for p in packages: sendmail(make_message(p)) for p in packages: - print "\t- %s <unfixed> (bug filed)" % p + print("\t- %s <unfixed> (bug filed)" % p) |