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
import sys
v = sys.version_info
if v[:2] < (3, 4):
error = "This version of Kwant requires Python 3.4 or above.\n"
if v[0] == 2:
error += "Kwant 1.1 is the last version to support Python 2."
print(error, file=sys.stderr)
sys.exit(1)
def ensure_python(required_version):
v = sys.version_info
if v[:3] < required_version:
error = "This version of Kwant requires Python {} or above.".format(
".".join(str(p) for p in required_version))
if v[0] == 2:
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 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