From cc8c15c32f33d0707aef27996a176f69c94393ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 18 Jul 2024 10:39:14 +0200 Subject: [PATCH] SCons: Remove old Python 2 compat code --- SConstruct | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/SConstruct b/SConstruct index f653d548..4d8f30b3 100644 --- a/SConstruct +++ b/SConstruct @@ -1,21 +1,11 @@ #!/usr/bin/env python +import codecs import os import sys import subprocess 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: # http://www.scons.org/wiki/LongCmdLinesOnWin32 @@ -258,7 +248,7 @@ elif env["platform"] == "ios": env.Append(CCFLAGS=["-miphoneos-version-min=10.0"]) 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): raise ValueError("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))