| |
@@ -1248,8 +1248,8 @@
|
| |
archlist = [pkg.header['arch'] for pkg in hdr.packages]
|
| |
if not archlist:
|
| |
raise rpkgError('No compatible build arches found in %s' % spec)
|
| |
- if six.PY3:
|
| |
- return [str(arch, encoding='utf-8') for arch in archlist]
|
| |
+ if hasattr(archlist[0], 'decode'):
|
| |
+ return [arch.decode('utf-8') for arch in archlist]
|
| |
else:
|
| |
return archlist
|
| |
|
| |
@@ -1339,9 +1339,10 @@
|
| |
hdr = koji.get_rpm_header(srpm)
|
| |
name = hdr[rpm.RPMTAG_NAME]
|
| |
contents = hdr[rpm.RPMTAG_FILENAMES]
|
| |
- if six.PY3:
|
| |
- name = str(name, encoding='utf-8')
|
| |
- contents = [str(filename, encoding='utf-8')
|
| |
+ if hasattr(name, 'decode'):
|
| |
+ # RPM before rhbz#1693751 returned bytes
|
| |
+ name = name.decode('utf-8')
|
| |
+ contents = [filename.decode('utf-8')
|
| |
for filename in contents]
|
| |
except Exception as e:
|
| |
raise rpkgError('Error querying srpm: {0}'.format(str(e)))
|
| |