Skip to content

Commit 3a7b4a2

Browse files
authored
Merge pull request swiftlang#33229 from compnerd/cryptic
test: explicitly encode arguments for Python 3
2 parents 09b6b74 + fc8f4b7 commit 3a7b4a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

utils/incrparse/test_util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ def run_command(cmd):
2525
if sys.version_info[0] < 3:
2626
cmd = list(map(lambda s: s.encode('utf-8'), cmd))
2727
print(' '.join([escapeCmdArg(arg) for arg in cmd]))
28-
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
28+
if sys.version_info[0] < 3:
29+
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
30+
else:
31+
return subprocess.check_output(list(map(lambda s: s.encode('utf-8'), cmd)),
32+
stderr=subprocess.STDOUT)
2933

3034

3135
def parseLine(line, line_no, test_case, incremental_edit_args, reparse_args,

0 commit comments

Comments
 (0)