diff --git a/scons/crossmingw.py b/scons/crossmingw.py index 609cd00418e..b2efccea7e8 100644 --- a/scons/crossmingw.py +++ b/scons/crossmingw.py @@ -128,9 +128,9 @@ def generate(env): if not path: path = [] if SCons.Util.is_String(path): - path = string.split(path, os.pathsep) + path = str.split(path, os.pathsep) - env['ENV']['PATH'] = string.join([dir] + path, os.pathsep) + env['ENV']['PATH'] = str.join(os.pathsep, [dir] + path) # Most of mingw is the same as gcc and friends... gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas'] diff --git a/scons/custom.py b/scons/custom.py index 8028990ef61..d2576ae9ddb 100644 --- a/scons/custom.py +++ b/scons/custom.py @@ -262,8 +262,13 @@ def parse_source_list(env, filename, names=None): sym_table = parser.parse(src.abspath) if names: - if isinstance(names, basestring): - names = [names] + import sys + if sys.version_info[0] >= 3: + if isinstance(names, str): + names = [names] + else: + if isinstance(names, basestring): + names = [names] symbols = names else: diff --git a/scons/gallium.py b/scons/gallium.py index 72d8604169e..9381f804a31 100755 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -132,7 +132,7 @@ def check_cc(env, cc, expr, cpp_opt = '-E'): sys.stdout.write('Checking for %s ... ' % cc) source = tempfile.NamedTemporaryFile(suffix='.c', delete=False) - source.write('#if !(%s)\n#error\n#endif\n' % expr) + source.write(('#if !(%s)\n#error\n#endif\n' % expr).encode()) source.close() # sys.stderr.write('%r %s %s\n' % (env['CC'], cpp_opt, source.name)); diff --git a/src/freedreno/vulkan/tu_extensions.py b/src/freedreno/vulkan/tu_extensions.py index 0a45b859e2b..dbb3a72d71e 100644 --- a/src/freedreno/vulkan/tu_extensions.py +++ b/src/freedreno/vulkan/tu_extensions.py @@ -79,7 +79,7 @@ EXTENSIONS = [ class VkVersion: def __init__(self, string): - split = string.split('.') + split = str.split('.') self.major = int(split[0]) self.minor = int(split[1]) if len(split) > 2: diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index dad49a1e564..60f97dd3e08 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -186,7 +186,7 @@ for i in range(len(EXTENSIONS) - 1): class VkVersion: def __init__(self, string): - split = string.split('.') + split = str.split('.') self.major = int(split[0]) self.minor = int(split[1]) if len(split) > 2: