aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2019-12-03 17:51:37 +0100
committerGravatar Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2019-12-03 23:00:01 +0100
commit5cfe5d789796919d815c5707928bd5f4febad3bf (patch)
treecfff7a0aba5e786c3f7f98ad1855cd79665566cf
parent99767380edd34ccb560922707d41ec844c3b649f (diff)
downloadbuildroot-5cfe5d789796919d815c5707928bd5f4febad3bf.tar.gz
buildroot-5cfe5d789796919d815c5707928bd5f4febad3bf.tar.bz2
utils/genrandconfig: fix runtime issue with Python 3
With Python 3.7, genrandconfig fails with: 'str' object has no attribute 'decode' We are already working on str objects, and there is no need to decode them, so we drop the call to decode_byte_list() and its definition as it was only used there. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
-rwxr-xr-xutils/genrandconfig10
1 files changed, 1 insertions, 9 deletions
diff --git a/utils/genrandconfig b/utils/genrandconfig
index aaba6c4204..c221ebd670 100755
--- a/utils/genrandconfig
+++ b/utils/genrandconfig
@@ -39,14 +39,6 @@ def urlopen_closing(uri):
return contextlib.closing(_urllib.urlopen(uri))
-if sys.hexversion >= 0x3000000:
- def decode_byte_list(bl):
- return [b.decode() for b in bl]
-else:
- def decode_byte_list(e):
- return e
-
-
class SystemInfo:
DEFAULT_NEEDED_PROGS = ["make", "git", "gcc", "timeout"]
DEFAULT_OPTIONAL_PROGS = ["bzr", "java", "javac", "jar", "diffoscope"]
@@ -128,7 +120,7 @@ def get_toolchain_configs(toolchains_csv, buildrootdir):
with open(toolchains_csv) as r:
# filter empty lines and comments
lines = [t for t in r.readlines() if len(t.strip()) > 0 and t[0] != '#']
- toolchains = decode_byte_list(lines)
+ toolchains = lines
configs = []
(_, _, _, _, hostarch) = os.uname()