From e4138635316c0b42ba20c8a28e77de8616fa989e Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 7 Sep 2017 22:38:52 +0100 Subject: [PATCH] Fix running command nodes on python 3 --- cibuildwheel/bashlex_eval.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cibuildwheel/bashlex_eval.py b/cibuildwheel/bashlex_eval.py index 90a399fe..af1ef5ba 100644 --- a/cibuildwheel/bashlex_eval.py +++ b/cibuildwheel/bashlex_eval.py @@ -1,4 +1,4 @@ -import subprocess, shlex +import subprocess, shlex, sys from collections import namedtuple import bashlex @@ -60,8 +60,12 @@ def evaluate_word_node(node, context): def evaluate_command_node(node, context): words = [evaluate_node(part, context=context) for part in node.parts] command = ' '.join(words) - return subprocess.check_output(shlex.split(command), env=context.environment) + output = subprocess.check_output(shlex.split(command), env=context.environment) + if sys.version_info[0] >= 3: + return output.decode('utf8', 'replace') + else: + return output def evaluate_parameter_node(node, context): return context.environment.get(node.value, '')