From 67871314dfb7ab49285cb7fa5c9dc0c1e9737354 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 20 2018 12:01:02 +0000 Subject: Check if there is the corresponding runner before running py2 or py3 Signed-off-by: Pierre-Yves Chibon --- diff --git a/runtests.py b/runtests.py index e08455e..416f4ff 100755 --- a/runtests.py +++ b/runtests.py @@ -378,6 +378,26 @@ def _run_test_suites(args, suites): elif args.py3: pyvers = (3,) + if 2 in pyvers: + try: + subprocess.check_call(["which", RUNNER_PY2]) + except subprocess.CalledProcessError: + print("No %s found, removing python 2" % RUNNER_PY2) + if 3 in pyvers: + pyvers = (3,) + else: + return 1 + + if 3 in pyvers: + try: + subprocess.check_call(["which", RUNNER_PY3]) + except subprocess.CalledProcessError: + print("No %s found, removing python 3" % RUNNER_PY3) + if 2 in pyvers: + pyvers = (2,) + else: + return 1 + for suite in suites: for pyver in pyvers: NUMREMAINING += 1