From 218f5c5a2fb3da6978fdbcd3ef07fa5dcdb9539c Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Sun, 25 Jan 2015 21:49:03 +0100 Subject: more python3 fixes --- mgagnome | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mgagnome b/mgagnome index dfc86b9..16a505e 100755 --- a/mgagnome +++ b/mgagnome @@ -319,7 +319,7 @@ if not hasattr(tarfile.TarFile, 'xzopen'): tarfile.open = XzTarFile.open def is_valid_hash(path, algo, hexdigest): - if algo not in hashlib.algorithms: + if algo not in hashlib.algorithms_available: raise ValueError("Unknown hash algorithm: %s" % algo) local_hash = getattr(hashlib, algo)() @@ -1015,7 +1015,7 @@ class Downstream(object): DISTRO=None def __init__(self): - contents = subprocess.check_output(['urpmf', '--qf', '%name|%version|%files', '.', "--media", self.MEDIA], close_fds=True).strip("\n").splitlines() + contents = subprocess.check_output(['urpmf', '--qf', '%name|%version|%files', '.', "--media", self.MEDIA], close_fds=True).decode("utf-8").strip("\n").splitlines() FILES = {} TARBALLS = {} @@ -1023,7 +1023,7 @@ class Downstream(object): for line in contents: try: - srpm, version, filename = line.decode("utf-8").split("|") + srpm, version, filename = line.split("|") except ValueError: print(line, file=sys.stderr) continue @@ -1575,7 +1575,7 @@ def cmd_parse_ftp_release_list(options, parser): p.wait() - msg = email.email.message_from_file(sys.stdin) + msg = email.message_from_file(sys.stdin) if options.mail: stdout = tempfile.TemporaryFile() -- cgit v1.2.1