diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2019-08-23 12:55:38 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2019-08-23 13:29:27 +0200 |
commit | 71b2374d9c080a1a1a71f8040a0c41a6fd8bf000 (patch) | |
tree | e0c5b946e7fa0ddeffa9827d0f19c9f027cd48b6 /build/mixxx.py | |
parent | bb75e595893a6003f3dff8c2377146be5e3d092e (diff) |
scons: Restore Python 2.7 compatibility
This re-adds 'utf-8' to bytes.decode() calls and replaces
FileNotFoundError with OSError to restore compatibility with Python 2.7.
When Python 2.7 finally reaches EOL we can simply revert this commit.
Diffstat (limited to 'build/mixxx.py')
-rw-r--r-- | build/mixxx.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/build/mixxx.py b/build/mixxx.py index 3b75d71d2f..370134fceb 100644 --- a/build/mixxx.py +++ b/build/mixxx.py @@ -170,11 +170,11 @@ class MixxxBuild(object): pkg_config_cmd = ['pkg-config', '--variable=includedir', 'Qt5Core'] try: output = subprocess.check_output(pkg_config_cmd) - except FileNotFoundError: + except OSError: # pkg-config is not installed pass else: - default_qtdir = output.decode().rstrip() + default_qtdir = output.decode('utf-8').rstrip() # Ugly hack to check the qtdir argument qtdir = Script.ARGUMENTS.get( @@ -229,7 +229,7 @@ class MixxxBuild(object): self.compiler_is_clang = False else: cc_version_cmd = shlex.split(self.env['CC']) + ['--version'] - cc_version = subprocess.check_output(cc_version_cmd).decode() + cc_version = subprocess.check_output(cc_version_cmd).decode('utf-8') self.compiler_is_gcc = 'gcc' in cc_version.lower() self.compiler_is_clang = 'clang' in cc_version.lower() @@ -237,7 +237,7 @@ class MixxxBuild(object): if self.compiler_is_gcc: self.gcc_major_version = None gcc_version_cmd = shlex.split(self.env['CC']) + ['-dumpversion'] - gcc_version = subprocess.check_output(gcc_version_cmd).decode() + gcc_version = subprocess.check_output(gcc_version_cmd).decode('utf-8') # If match is None we don't know the version. if not gcc_version is None: version_split = gcc_version.split('.') |