gitinspector now checks it is running under the required Python version.

The required Python version is 2.6. The check is done after all the
command-line arguments have been parsed. In this way, it is still possible
to get help and version information from the script even if the script is
not able to execute properly.
This commit is contained in:
Adam Waldenberg 2013-06-05 01:50:29 +02:00
parent f95e81bb69
commit d5fc9057fb

View file

@ -77,6 +77,11 @@ class Runner:
format.output_footer()
os.chdir(previous_directory)
def __check_python_version__():
if sys.version_info < (2,6):
python_version = str(sys.version_info[0]) + "." + str(sys.version_info[1])
sys.exit("gitinspector requires at leat Python 2.6 to run (version " + python_version + " was found).")
if __name__ == "__main__":
__run__ = Runner()
@ -133,4 +138,5 @@ if __name__ == "__main__":
print("Try `", sys.argv[0], "--help' for more information.")
sys.exit(2)
__check_python_version__()
__run__.output()