mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-16 00:28:25 +01:00
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:
parent
f95e81bb69
commit
d5fc9057fb
1 changed files with 6 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue