Browse Source

SCons: Fix Python 3 support in GCC version check

Rémi Verschelde 6 years ago
parent
commit
04ea848116
2 changed files with 2 additions and 2 deletions
  1. 1 1
      platform/server/detect.py
  2. 1 1
      platform/x11/detect.py

+ 1 - 1
platform/server/detect.py

@@ -44,7 +44,7 @@ def configure(env):
         # Hack to prevent building this branch with GCC 6+, which trigger segfaults due to UB when dereferencing pointers in Object::cast_to
         # Hack to prevent building this branch with GCC 6+, which trigger segfaults due to UB when dereferencing pointers in Object::cast_to
         # This is fixed in the master branch, for 2.1 we just prevent using too recent GCC versions.
         # This is fixed in the master branch, for 2.1 we just prevent using too recent GCC versions.
         import subprocess
         import subprocess
-        gcc_major = subprocess.check_output(['gcc', '-dumpversion'])[0].split()[0]
+        gcc_major = subprocess.check_output(['gcc', '-dumpversion']).decode('ascii').split('.')[0]
         if (int(gcc_major) > 5):
         if (int(gcc_major) > 5):
             print("Your configured compiler appears to be GCC %s, which triggers issues in release builds for this version of Godot (fixed in Godot 3.0+)." % gcc_major)
             print("Your configured compiler appears to be GCC %s, which triggers issues in release builds for this version of Godot (fixed in Godot 3.0+)." % gcc_major)
             print("You can use the Clang compiler instead with the `use_llvm=yes` option, or configure another compiler such as GCC 5 using the CC, CXX and LD flags.")
             print("You can use the Clang compiler instead with the `use_llvm=yes` option, or configure another compiler such as GCC 5 using the CC, CXX and LD flags.")

+ 1 - 1
platform/x11/detect.py

@@ -95,7 +95,7 @@ def configure(env):
         # Hack to prevent building this branch with GCC 6+, which trigger segfaults due to UB when dereferencing pointers in Object::cast_to
         # Hack to prevent building this branch with GCC 6+, which trigger segfaults due to UB when dereferencing pointers in Object::cast_to
         # This is fixed in the master branch, for 2.1 we just prevent using too recent GCC versions.
         # This is fixed in the master branch, for 2.1 we just prevent using too recent GCC versions.
         import subprocess
         import subprocess
-        gcc_major = subprocess.check_output(['gcc', '-dumpversion'])[0].split()[0]
+        gcc_major = subprocess.check_output(['gcc', '-dumpversion']).decode('ascii').split('.')[0]
         if (int(gcc_major) > 5):
         if (int(gcc_major) > 5):
             print("Your configured compiler appears to be GCC %s, which triggers issues in release builds for this version of Godot (fixed in Godot 3.0+)." % gcc_major)
             print("Your configured compiler appears to be GCC %s, which triggers issues in release builds for this version of Godot (fixed in Godot 3.0+)." % gcc_major)
             print("You can use the Clang compiler instead with the `use_llvm=yes` option, or configure another compiler such as GCC 5 using the CC, CXX and LD flags.")
             print("You can use the Clang compiler instead with the `use_llvm=yes` option, or configure another compiler such as GCC 5 using the CC, CXX and LD flags.")