Skip to content

Commit 9cff36e

Browse files
authored
Merge pull request #1358 from ahoppen/ahoppen/decode-utf8
Specify encoding when running a ninja invocation
2 parents d8a3480 + 6359e9a commit 9cff36e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Utilities/build-script-helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def swiftpm_bin_path(swift_exec, swiftpm_args, env=None):
6666
swiftpm_args = [arg for arg in swiftpm_args if arg != '-v' and arg != '--verbose']
6767
cmd = [swift_exec, 'build', '--show-bin-path'] + swiftpm_args
6868
print(' '.join(cmd))
69-
return subprocess.check_output(cmd, env=env).strip().decode("UTF-8")
69+
return subprocess.check_output(cmd, env=env, encoding='utf-8').strip()
7070

7171
def get_swiftpm_options(args):
7272
swiftpm_args = [
@@ -585,7 +585,8 @@ def cmake_build(args, swiftc_exec, cmake_args, swift_flags, source_path,
585585
ninjaProcess = subprocess.Popen(ninja_cmd, cwd=build_dir,
586586
stdout=subprocess.PIPE,
587587
stderr=subprocess.PIPE,
588-
env = os.environ)
588+
env = os.environ,
589+
encoding='utf-8')
589590
stdout, stderr = ninjaProcess.communicate()
590591
if ninjaProcess.returncode != 0:
591592
print(stdout)

0 commit comments

Comments
 (0)