Skip to content

Commit 07153d4

Browse files
authored
Merge pull request #1531 from akien-mga/3.x-py-two-old
[3.x] SCons: Remove old Python 2 compat code
2 parents a4aecf3 + cc8c15c commit 07153d4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

SConstruct

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
#!/usr/bin/env python
22

3+
import codecs
34
import os
45
import sys
56
import subprocess
67
from binding_generator import scons_generate_bindings, scons_emit_files
78

8-
if sys.version_info < (3,):
9-
10-
def decode_utf8(x):
11-
return x
12-
13-
else:
14-
import codecs
15-
16-
def decode_utf8(x):
17-
return codecs.utf_8_decode(x)[0]
18-
199

2010
# Workaround for MinGW. See:
2111
# http://www.scons.org/wiki/LongCmdLinesOnWin32
@@ -258,7 +248,7 @@ elif env["platform"] == "ios":
258248
env.Append(CCFLAGS=["-miphoneos-version-min=10.0"])
259249

260250
try:
261-
sdk_path = decode_utf8(subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip())
251+
sdk_path = codecs.utf_8_decode(subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip())[0]
262252
except (subprocess.CalledProcessError, OSError):
263253
raise ValueError("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
264254

0 commit comments

Comments
 (0)