# HG changeset patch # User Augie Fackler # Date 2015-05-18 01:17:13 # 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 --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -303,8 +303,9 @@ def parseargs(args, parser): '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: