From e1ffdbd33dae42cc061fa453ecfaf823947cd399 Mon Sep 17 00:00:00 2001 From: Samuel Sadok Date: Fri, 31 Jul 2020 10:50:06 +0200 Subject: [PATCH] fix Anaconda Python detection on Windows Anaconda prints version information on stderr instead of stdout. --- Firmware/Tupfile.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Firmware/Tupfile.lua b/Firmware/Tupfile.lua index bf077598..7f5380ae 100644 --- a/Firmware/Tupfile.lua +++ b/Firmware/Tupfile.lua @@ -6,9 +6,9 @@ tup.include('build.lua') -- command "python --version" does not open the Microsoft Store. -- On some systems this may return a python2 command if Python3 is not installed. function find_python3() - success, python_version = run_now("python --version") + success, python_version = run_now("python --version 2>&1") if success and string.match(python_version, "Python 3") then return "python -B" end - success, python_version = run_now("python3 --version") + success, python_version = run_now("python3 --version 2>&1") if success and string.match(python_version, "Python 3") then return "python3 -B" end error("Python 3 not found.") end @@ -16,8 +16,6 @@ end python_command = find_python3() print('Using python command "'..python_command..'"') -run_now("") - tup.frule{inputs={'fibre/cpp/interfaces_template.j2'}, command=python_command..' interface_generator_stub.py --definitions odrive-interface.yaml --template %f --output %o', outputs='autogen/interfaces.hpp'} tup.frule{inputs={'fibre/cpp/function_stubs_template.j2'}, command=python_command..' interface_generator_stub.py --definitions odrive-interface.yaml --template %f --output %o', outputs='autogen/function_stubs.hpp'} tup.frule{inputs={'fibre/cpp/endpoints_template.j2'}, command=python_command..' interface_generator_stub.py --definitions odrive-interface.yaml --generate-endpoints ODrive --template %f --output %o', outputs='autogen/endpoints.hpp'}