Permalink
Browse files

Use Python launcher if present (#7541)

* The scons batch file now will use the Python launcher if available to specifically launch scons.py with Python 2.7 32 bit. If the launcher does not exist, it falls back to the original vehaviour of getting the shell to open scons.py.
  • Loading branch information...
francipvb authored and michaelDCurran committed Feb 2, 2018
1 parent 2017d1f commit d7ce072beb66005deaa07916c941c60738b5b465
Showing with 10 additions and 2 deletions.
  1. +10 −2 scons.bat
View
@@ -1,5 +1,13 @@
@echo off
rem We need this script because .py probably isn't in pathext.
rem We can't just call python -c because it may not be in the path.
rem Python registers itself with the .py extension, so call scons.py.
"%~dp0\scons.py" %*
rem Instead, find the python launcher (installed by python 3)
where py 1>nul 2>&1
if "%ERRORLEVEL%" == "0" (
rem Python launcher is present in the PATH
rem Call python 2.7 for 32 bits
py -2.7-32 "%~dp0\scons.py" %*
) else (
rem Python registers itself with the .py extension, so call scons.py.
"%~dp0\scons.py" %*
)

0 comments on commit d7ce072

Please sign in to comment.