[Bf-blender-cvs] [870fcb3857b] master: Cleanup: change Python version checks to include newer versions

Campbell Barton noreply at git.blender.org
Mon Sep 7 15:14:47 CEST 2020


Commit: 870fcb3857ba36986d1d44ab4ac519897f8fb264
Author: Campbell Barton
Date:   Mon Sep 7 22:58:16 2020 +1000
Branches: master
https://developer.blender.org/rB870fcb3857ba36986d1d44ab4ac519897f8fb264

Cleanup: change Python version checks to include newer versions

===================================================================

M	build_files/cmake/cmake_consistency_check.py
M	build_files/cmake/project_source_info.py
M	source/blender/makesrna/rna_cleanup/rna_cleaner.py

===================================================================

diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py
index b4c91e6ba4f..cdf4058d394 100755
--- a/build_files/cmake/cmake_consistency_check.py
+++ b/build_files/cmake/cmake_consistency_check.py
@@ -21,7 +21,7 @@
 # <pep8 compliant>
 
 import sys
-if not sys.version.startswith("3"):
+if sys.version_info.major < 3:
     print("\nPython3.x needed, found %s.\nAborting!\n" %
           sys.version.partition(" ")[0])
     sys.exit(1)
diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py
index 6649f4620c8..f8067c216fd 100644
--- a/build_files/cmake/project_source_info.py
+++ b/build_files/cmake/project_source_info.py
@@ -25,8 +25,8 @@ __all__ = (
 
 
 import sys
-if not sys.version.startswith("3"):
-    print("\nPython3.x needed, found %s.\nAborting!\n" %
+if not sys.version_info.major < 3:
+    print("\nPython3.x or newer needed, found %s.\nAborting!\n" %
           sys.version.partition(" ")[0])
     sys.exit(1)
 
diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
index a936e6499bc..f107b5aee63 100755
--- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py
+++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
@@ -321,7 +321,7 @@ def main():
 
 if __name__ == '__main__':
     import sys
-    if not sys.version.startswith("3"):
-        print("Incorrect python version, use python 3!")
+    if sys.version_info.major < 3:
+        print("Incorrect python version, use Python 3 or newer!")
     else:
         main()



More information about the Bf-blender-cvs mailing list