Skip to content

Commit 958776d

Browse files
committed
SCons: Remove old Python 2 compat code
1 parent 0a1e31f commit 958776d

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tools/ios.py

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1+
import codecs
12
import os
23
import subprocess
34
import sys
45

56
import common_compiler_flags
67
from SCons.Variables import BoolVariable
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
def has_ios_osxcross():
2111
return "OSXCROSS_IOS" in os.environ
@@ -53,9 +43,9 @@ def generate(env):
5343
if sys.platform == "darwin":
5444
if env["IOS_SDK_PATH"] == "":
5545
try:
56-
env["IOS_SDK_PATH"] = decode_utf8(
46+
env["IOS_SDK_PATH"] = codecs.utf_8_decode(
5747
subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip()
58-
)
48+
)[0]
5949
except (subprocess.CalledProcessError, OSError):
6050
raise ValueError(
6151
"Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name)

0 commit comments

Comments
 (0)