# HG changeset patch # User Augie Fackler # Date 1431911833 14400 # Node ID 3906b9783cd9d5d48c226d4e00b612c76d5526d5 # Parent a8d22895a575ffaa88b8cf43ef6897b4b25b8503 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. diff -r a8d22895a575 -r 3906b9783cd9 tests/run-tests.py --- 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: