From 03974485016654de09e42737ea875bc601d5ec56 Mon Sep 17 00:00:00 2001 From: stijn Date: Thu, 14 Jan 2021 13:23:15 +0100 Subject: [PATCH] tests/run-tests: Change default Python command used on Windows. Default to just calling python since that is most commonly available: the official installer or zipfiles from python.org, anaconda, nupkg all result in python being available but not python3. In other words: the default used so far is wrong. Note that os.name is 'posix' when running the python version which comes with Cygwin or MSys2 so they are not affected by this. However of all possible ways to get Python on Windows, only Cygwin provides no python command so update the default way for running tests in the README. --- ports/windows/README.md | 4 ++++ tests/run-tests | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/windows/README.md b/ports/windows/README.md index 8d907d1b72..1b904f8f5e 100644 --- a/ports/windows/README.md +++ b/ports/windows/README.md @@ -90,6 +90,10 @@ Running the tests This is similar for all ports: cd ../../tests + python ./run-tests + +Though when running on Cygwin and using Cygwin's Python installation you'll need: + python3 ./run-tests Depending on the combination of platform and Python version used it might be diff --git a/tests/run-tests b/tests/run-tests index cb5b5cd0a5..b733d8a9fc 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -20,7 +20,7 @@ def base_path(*p): # is of lower version, you can point MICROPY_CPYTHON3 environment var # to the correct executable. if os.name == 'nt': - CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3.exe') + CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python') MICROPYTHON = os.getenv('MICROPY_MICROPYTHON', base_path('../ports/windows/micropython.exe')) else: CPYTHON3 = os.getenv('MICROPY_CPYTHON3', 'python3')