Skip to content

Commit dc4a7f6

Browse files
authored
Improve error handling for missing Python executable
1 parent b4c7735 commit dc4a7f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builder/penv_setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ def _setup_python_environment_core(env, platform, platformio_dir, should_install
452452
env.Replace(PYTHONEXE=penv_python)
453453

454454
# check for python binary, exit with error when not found
455-
assert os.path.isfile(penv_python), f"Python executable not found: {penv_python}"
455+
if not os.path.isfile(penv_python):
456+
sys.stderr.write(f"Error: Python executable not found: {penv_python}\n")
457+
sys.exit(1)
456458

457459
# Setup Python module search paths
458460
setup_python_paths(penv_dir)

0 commit comments

Comments
 (0)