SCons: Remove old Python 2 compat code
parent
0a1e31fa45
commit
958776dfc3
16
tools/ios.py
16
tools/ios.py
|
@ -1,3 +1,4 @@
|
||||||
|
import codecs
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -5,17 +6,6 @@ import sys
|
||||||
import common_compiler_flags
|
import common_compiler_flags
|
||||||
from SCons.Variables import BoolVariable
|
from SCons.Variables import BoolVariable
|
||||||
|
|
||||||
if sys.version_info < (3,):
|
|
||||||
|
|
||||||
def decode_utf8(x):
|
|
||||||
return x
|
|
||||||
|
|
||||||
else:
|
|
||||||
import codecs
|
|
||||||
|
|
||||||
def decode_utf8(x):
|
|
||||||
return codecs.utf_8_decode(x)[0]
|
|
||||||
|
|
||||||
|
|
||||||
def has_ios_osxcross():
|
def has_ios_osxcross():
|
||||||
return "OSXCROSS_IOS" in os.environ
|
return "OSXCROSS_IOS" in os.environ
|
||||||
|
@ -53,9 +43,9 @@ def generate(env):
|
||||||
if sys.platform == "darwin":
|
if sys.platform == "darwin":
|
||||||
if env["IOS_SDK_PATH"] == "":
|
if env["IOS_SDK_PATH"] == "":
|
||||||
try:
|
try:
|
||||||
env["IOS_SDK_PATH"] = decode_utf8(
|
env["IOS_SDK_PATH"] = codecs.utf_8_decode(
|
||||||
subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip()
|
subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip()
|
||||||
)
|
)[0]
|
||||||
except (subprocess.CalledProcessError, OSError):
|
except (subprocess.CalledProcessError, OSError):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name)
|
"Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name)
|
||||||
|
|
Loading…
Reference in New Issue