run-tests: insist that if people use Python 3, they use 3.5.x
authorAugie Fackler <augie@google.com>
Sun, 17 May 2015 21:26:04 -0400
changeset 25160 fefc72523491
parent 25159 138dc8381049
child 25161 4d30467d944e
run-tests: insist that if people use Python 3, they use 3.5.x We depend on both stdlib functionality (difflib.diff_bytes) and language behavior (bytes formatting) introduced in 3.5, so let's try and prevent some useless bug reports before they happen.
tests/run-tests.py
--- a/tests/run-tests.py	Sun May 17 21:18:56 2015 -0400
+++ b/tests/run-tests.py	Sun May 17 21:26:04 2015 -0400
@@ -78,9 +78,13 @@
 
 processlock = threading.Lock()
 
-if sys.version_info > (3, 0, 0):
+if sys.version_info > (3, 5, 0):
     PYTHON3 = True
     xrange = range # we use xrange in one place, and we'd rather not use range
+elif sys.version_info >= (3, 0, 0):
+    print('%s is only supported on Python 3.5+ and 2.6-2.7, not %s' %
+          (sys.argv[0], '.'.join(str(v) for v in sys.version_info[:3])))
+    sys.exit(70) # EX_SOFTWARE from `man 3 sysexit`
 else:
     PYTHON3 = False