Merge pull request #1531 from akien-mga/3.x-py-two-old
[3.x] SCons: Remove old Python 2 compat code3.x
commit
07153d40e0
14
SConstruct
14
SConstruct
|
@ -1,21 +1,11 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import codecs
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from binding_generator import scons_generate_bindings, scons_emit_files
|
from binding_generator import scons_generate_bindings, scons_emit_files
|
||||||
|
|
||||||
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]
|
|
||||||
|
|
||||||
|
|
||||||
# Workaround for MinGW. See:
|
# Workaround for MinGW. See:
|
||||||
# http://www.scons.org/wiki/LongCmdLinesOnWin32
|
# http://www.scons.org/wiki/LongCmdLinesOnWin32
|
||||||
|
@ -258,7 +248,7 @@ elif env["platform"] == "ios":
|
||||||
env.Append(CCFLAGS=["-miphoneos-version-min=10.0"])
|
env.Append(CCFLAGS=["-miphoneos-version-min=10.0"])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sdk_path = decode_utf8(subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip())
|
sdk_path = codecs.utf_8_decode(subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip())[0]
|
||||||
except (subprocess.CalledProcessError, OSError):
|
except (subprocess.CalledProcessError, OSError):
|
||||||
raise ValueError("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
|
raise ValueError("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue