🧑‍💻 Fix Python detection on Windows (#28733)

This commit is contained in:
ellensp 2026-10-24 09:37:47 +13:00 • committed by GitHub
parent 0e29237521
commit 782697fca1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,8 +9,8 @@ export PRETTIER_VERSION
# Find a Python 3 interpreter
ifeq ($(OS),Windows_NT)
# Windows: use `where` – fall back through the three common names
PYTHON := $(shell which python 2>nul || which python3 2>nul || which py 2>nul)
# Windows: use the first of the three common names that runs
PYTHON := $(if $(filter ok,$(shell python -c "print('ok')" 2>/dev/null)),python,$(if $(filter ok,$(shell python3 -c "print('ok')" 2>/dev/null)),python3,py))
# Windows: Use Python script to find pins files
ALL_PINS := $(shell $(PYTHON) $(MAKESCRIPTS_DIR)/find.py Marlin/src/pins -mindepth 2 -name 'pins_*.h')
else