diff options
author | David Snopek <dsnopek@gmail.com> | 2024-07-24 09:06:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-24 09:06:01 -0500 |
commit | f2b521f55a0a2ba7080418ba898b97028da6134a (patch) | |
tree | 089011fa00319152cf8dd67001ce35d69f59ff97 | |
parent | 628606b28b1be7760bb2a9a19796446629515e59 (diff) | |
parent | 958776dfc3ea845e3a92384cf5b57b54229d9b28 (diff) | |
download | redot-cpp-f2b521f55a0a2ba7080418ba898b97028da6134a.tar.gz |
Merge pull request #1530 from akien-mga/py-two-old
SCons: Remove old Python 2 compat code
-rw-r--r-- | tools/ios.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tools/ios.py b/tools/ios.py index 7240a97..9675ab1 100644 --- a/tools/ios.py +++ b/tools/ios.py @@ -1,3 +1,4 @@ +import codecs import os import subprocess import sys @@ -5,17 +6,6 @@ import sys import common_compiler_flags 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(): return "OSXCROSS_IOS" in os.environ @@ -53,9 +43,9 @@ def generate(env): if sys.platform == "darwin": if env["IOS_SDK_PATH"] == "": 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() - ) + )[0] except (subprocess.CalledProcessError, OSError): raise ValueError( "Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name) |