diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-25 14:36:03 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-25 15:25:37 +0100 |
commit | 3d2dd79ecd2c8456ba9401f6b12333d01f61e13e (patch) | |
tree | 945849b824e902a49bb3d7acb4bf13f76a1850f8 /modules | |
parent | 35e700e931f565aa37040055126fa61f02424ae0 (diff) |
SCons: Drop support for Python 2
We now require SCons 3.0+ (first version with Python 3 support),
and we set min required Python 3 version to 3.5 (3.4 and earlier are
EOL).
Diffstat (limited to 'modules')
-rw-r--r-- | modules/freetype/SCsub | 4 | ||||
-rw-r--r-- | modules/mono/build_scripts/make_android_mono_config.py | 3 | ||||
-rw-r--r-- | modules/mono/build_scripts/mono_reg_utils.py | 9 |
3 files changed, 4 insertions, 12 deletions
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index 7b66aa1c76..9e1853c4cd 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -3,8 +3,6 @@ Import('env') Import('env_modules') -from compat import isbasestring - env_freetype = env_modules.Clone() # Thirdparty source files @@ -93,7 +91,7 @@ if env['builtin_freetype']: # and then plain strings for system library. We insert between the two. inserted = False for idx, linklib in enumerate(env["LIBS"]): - if isbasestring(linklib): # first system lib such as "X11", otherwise SCons lib object + if isinstance(linklib, (str, bytes)): # first system lib such as "X11", otherwise SCons lib object env["LIBS"].insert(idx, lib) inserted = True break diff --git a/modules/mono/build_scripts/make_android_mono_config.py b/modules/mono/build_scripts/make_android_mono_config.py index 0afd939c57..4f5a496891 100644 --- a/modules/mono/build_scripts/make_android_mono_config.py +++ b/modules/mono/build_scripts/make_android_mono_config.py @@ -1,7 +1,6 @@ def generate_compressed_config(config_src, output_dir): import os.path - from compat import byte_to_str # Source file with open(os.path.join(output_dir, 'android_mono_config.gen.cpp'), 'w') as cpp: @@ -16,7 +15,7 @@ def generate_compressed_config(config_src, output_dir): for i, buf_idx in enumerate(range(compr_size)): if i > 0: bytes_seq_str += ', ' - bytes_seq_str += byte_to_str(buf[buf_idx]) + bytes_seq_str += str(buf[buf_idx]) cpp.write('''/* THIS FILE IS GENERATED DO NOT EDIT */ #include "android_mono_config.h" diff --git a/modules/mono/build_scripts/mono_reg_utils.py b/modules/mono/build_scripts/mono_reg_utils.py index b2c48f0a61..3bae11b167 100644 --- a/modules/mono/build_scripts/mono_reg_utils.py +++ b/modules/mono/build_scripts/mono_reg_utils.py @@ -1,14 +1,9 @@ import os import platform -from compat import decode_utf8 - if os.name == 'nt': import sys - if sys.version_info < (3,): - import _winreg as winreg - else: - import winreg + import winreg def _reg_open_key(key, subkey): @@ -81,7 +76,7 @@ def find_msbuild_tools_path_reg(): lines = subprocess.check_output([vswhere] + vswhere_args).splitlines() for line in lines: - parts = decode_utf8(line).split(':', 1) + parts = line.decode("utf-8").split(':', 1) if len(parts) < 2 or parts[0] != 'installationPath': continue |