Skip to content
Snippets Groups Projects
Commit 8238838c authored by Christoph Groth's avatar Christoph Groth
Browse files

setup.py: clean up Python version check

parent 4b0ba762
No related branches found
No related tags found
1 merge request!40Maintenance of setup.py
...@@ -12,13 +12,17 @@ from __future__ import print_function ...@@ -12,13 +12,17 @@ from __future__ import print_function
import sys import sys
v = sys.version_info def ensure_python(required_version):
if v[:2] < (3, 4): v = sys.version_info
error = "This version of Kwant requires Python 3.4 or above.\n" if v[:3] < required_version:
if v[0] == 2: error = "This version of Kwant requires Python {} or above.".format(
error += "Kwant 1.1 is the last version to support Python 2." ".".join(str(p) for p in required_version))
print(error, file=sys.stderr) if v[0] == 2:
sys.exit(1) error += "\nKwant 1.1 is the last version to support Python 2."
print(error, file=sys.stderr)
sys.exit(1)
ensure_python((3, 4))
import re import re
import os import os
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment