changeset 25160:fefc72523491

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.
author Augie Fackler <augie@google.com>
date Sun, 17 May 2015 21:26:04 -0400
parents 138dc8381049
children 4d30467d944e
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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