changeset 25158:3906b9783cd9

run-tests: prefer PYTHON3 constant to many version_info checks (issue4668) We only support Python 2.6, 2.7, and 3.5 here, so we can simplify the code and improve the warning.
author Augie Fackler <augie@google.com>
date Sun, 17 May 2015 21:17:13 -0400
parents a8d22895a575
children 138dc8381049
files tests/run-tests.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun May 17 21:12:33 2015 -0400
+++ b/tests/run-tests.py	Sun May 17 21:17:13 2015 -0400
@@ -303,8 +303,9 @@
                 'warning: --timeout option ignored with --debug\n')
         options.timeout = 0
     if options.py3k_warnings:
-        if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
-            parser.error('--py3k-warnings can only be used on Python 2.6+')
+        if PYTHON3:
+            parser.error(
+                '--py3k-warnings can only be used on Python 2.6 and 2.7')
     if options.blacklist:
         options.blacklist = parselistfiles(options.blacklist, 'blacklist')
     if options.whitelist: