diff options
author | Bastian Blank <waldi@debian.org> | 2014-02-15 09:44:36 +0000 |
---|---|---|
committer | Bastian Blank <waldi@debian.org> | 2014-02-15 09:44:36 +0000 |
commit | 4295eeaea6a51f5c5cd03c3bf998a72c9417469e (patch) | |
tree | e80e735db072f55172c04d4ce796a9faf1d4ddb1 | |
parent | 373d086904305699561b1eb505c33b010c24de9b (diff) | |
download | kernel_replicant_linux-4295eeaea6a51f5c5cd03c3bf998a72c9417469e.tar.gz kernel_replicant_linux-4295eeaea6a51f5c5cd03c3bf998a72c9417469e.tar.bz2 kernel_replicant_linux-4295eeaea6a51f5c5cd03c3bf998a72c9417469e.zip |
debian/bin/buildcheck.py, debian/bin/gencontrol.py: Support Python 3
svn path=/dists/trunk/linux/; revision=21047
-rwxr-xr-x | debian/bin/buildcheck.py | 2 | ||||
-rwxr-xr-x | debian/bin/gencontrol.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/debian/bin/buildcheck.py b/debian/bin/buildcheck.py index 2c38a777b64f..a6f6f062faea 100755 --- a/debian/bin/buildcheck.py +++ b/debian/bin/buildcheck.py @@ -214,7 +214,7 @@ class Main(object): def __init__(self, dir, arch, featureset, flavour): self.args = dir, arch, featureset, flavour - self.config = ConfigCoreDump(fp=file("debian/config.defines.dump")) + self.config = ConfigCoreDump(open("debian/config.defines.dump", "rb")) def __call__(self): fail = 0 diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py index 9dae1ed223a4..62877b4abf60 100755 --- a/debian/bin/gencontrol.py +++ b/debian/bin/gencontrol.py @@ -6,6 +6,7 @@ sys.path.append("debian/lib/python") import codecs import errno import glob +import io import os import os.path import subprocess @@ -180,7 +181,10 @@ class Gencontrol(Base): ['kernel-wedge', 'gen-control', vars['abiname']], stdout=subprocess.PIPE, env=kw_env) - udeb_packages = read_control(kw_proc.stdout) + if not isinstance(kw_proc.stdout, io.IOBase): + udeb_packages = read_control(io.open(kw_proc.stdout.fileno(), encoding='utf-8', closefd=False)) + else: + udeb_packages = read_control(io.TextIOWrapper(kw_proc.stdout, 'utf-8')) kw_proc.wait() if kw_proc.returncode != 0: raise RuntimeError('kernel-wedge exited with code %d' % @@ -489,7 +493,7 @@ class Gencontrol(Base): def process_real_image(self, entry, fields, vars): entry = self.process_package(entry, vars) - for key, value in fields.iteritems(): + for key, value in fields.items(): if key in entry: real = entry[key] real.extend(value) @@ -502,7 +506,7 @@ class Gencontrol(Base): super(Gencontrol, self).write(packages, makefile) def write_config(self): - f = file("debian/config.defines.dump", 'w') + f = open("debian/config.defines.dump", 'wb') self.config.dump(f) f.close() |