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 | 040056377b0f2975a035178854fd37a42d912be6 (patch) | |
tree | 9adc0dd1fb299e0afcb024d403ca1f40356455e0 /lib/python/debian_support.py | |
parent | 33e88666be616576461487922d61985da4199776 (diff) |
Fix print statements for Python 3.6 compatibility
Diffstat (limited to 'lib/python/debian_support.py')
-rw-r--r-- | lib/python/debian_support.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/python/debian_support.py b/lib/python/debian_support.py index e4bc12ee77..26ce3507cf 100644 --- a/lib/python/debian_support.py +++ b/lib/python/debian_support.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +from __future__ import print_function """This module implements facilities to deal with Debian-specific metadata.""" @@ -320,7 +321,7 @@ def updateFile(remote, local, verbose=None): local_file = file(local) except IOError: if verbose: - print "updateFile: no local copy, downloading full file" + print("updateFile: no local copy, downloading full file") return downloadFile(remote, local) lines = local_file.readlines() @@ -338,11 +339,11 @@ def updateFile(remote, local, verbose=None): index_fields = list(PackageFile(index_name, index_url)) except ParseError: if verbose: - print "updateFile: could not interpret patch index file" + print("updateFile: could not interpret patch index file") return downloadFile(remote, local) except IOError: if verbose: - print "updateFile: could not download patch index file" + print("updateFile: could not download patch index file") return downloadFile(remote, local) for fields in index_fields: @@ -351,7 +352,7 @@ def updateFile(remote, local, verbose=None): (remote_hash, remote_size) = re_whitespace.split(value) if local_hash == remote_hash: if verbose: - print "updateFile: local file is up-to-date" + print("updateFile: local file is up-to-date") return lines continue @@ -379,16 +380,16 @@ def updateFile(remote, local, verbose=None): continue if verbose: - print "updateFile: field %s ignored" % `field` + print("updateFile: field %s ignored" % repr(field)) if not patches_to_apply: if verbose: - print "updateFile: could not find historic entry", local_hash + print("updateFile: could not find historic entry", local_hash) return downloadFile(remote, local) for patch_name in patches_to_apply: if verbose: - print "updateFile: downloading patch " + `patch_name` + print("updateFile: downloading patch " + repr(patch_name)) try: patch_contents = downloadGunzipLines(remote + '.diff/' + patch_name + '.gz') @@ -396,15 +397,15 @@ def updateFile(remote, local, verbose=None): return downloadFile(remote, local) if readLinesSHA1(patch_contents ) != patch_hashes[patch_name]: if verbose: - print "updateFile: patch was garbled: " + repr(patch_name) + print("updateFile: patch was garbled: " + repr(patch_name)) return downloadFile(remote, local) patchLines(lines, patchesFromEdScript(patch_contents)) new_hash = readLinesSHA1(lines) if new_hash != remote_hash: if verbose: - print "updateFile: patch failed, got %s instead of %s" \ - % (new_hash, remote_hash) + print("updateFile: patch failed, got %s instead of %s" + % (new_hash, remote_hash)) return downloadFile(remote, local) replaceFile(lines, local) |