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.
--- 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: