From 658552715140ef0e6f3be02c900260f99615344e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 19 Nov 2011 00:01:10 +0000 Subject: add python3 checks to avoid confusion from errors with python2. --- build_files/cmake/cmake_consistency_check.py | 6 ++++++ build_files/cmake/project_info.py | 7 +++++++ build_files/cmake/project_source_info.py | 8 ++++++++ 3 files changed, 21 insertions(+) (limited to 'build_files') diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py index be68455a113..65a9442a90d 100755 --- a/build_files/cmake/cmake_consistency_check.py +++ b/build_files/cmake/cmake_consistency_check.py @@ -22,6 +22,12 @@ # +import sys +if not sys.version.startswith("3"): + print("\nPython3.x needed, found %s.\nAborting!\n" % + sys.version.partition(" ")[0]) + sys.exit(1) + from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR import os diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py index 7162b324f94..dca41849a49 100755 --- a/build_files/cmake/project_info.py +++ b/build_files/cmake/project_info.py @@ -44,7 +44,14 @@ __all__ = ( "project_name_get" ) + import sys +if not sys.version.startswith("3"): + print("\nPython3.x needed, found %s.\nAborting!\n" % + sys.version.partition(" ")[0]) + sys.exit(1) + + import os from os.path import join, dirname, normpath, abspath, splitext, exists diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py index d4b48ccd859..a39ed94bd69 100644 --- a/build_files/cmake/project_source_info.py +++ b/build_files/cmake/project_source_info.py @@ -25,6 +25,14 @@ __all__ = ( "SOURCE_DIR", ) + +import sys +if not sys.version.startswith("3"): + print("\nPython3.x needed, found %s.\nAborting!\n" % + sys.version.partition(" ")[0]) + sys.exit(1) + + import os from os.path import join, dirname, normpath, abspath -- cgit v1.2.3