Skip to content

Commit

Permalink
SCons: Remove old Python 2 compat code
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Jul 18, 2024
1 parent 0a1e31f commit 958776d
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions tools/ios.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import codecs
import os
import subprocess
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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 958776d

Please sign in to comment.