summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-11-18 17:53:21 (GMT)
committerGitHub <noreply@github.com>2019-11-18 17:53:21 (GMT)
commitcbbf1098f383e575d93841e555329eb66283c2f1 (patch)
treeaaadabb3d8f69f84c2e8a54bf7d919c39b292665 /PCbuild
parentca877c7523b103e1cf5815d866ce66a13ecca6a2 (diff)
downloadcpython-cbbf1098f383e575d93841e555329eb66283c2f1.zip
cpython-cbbf1098f383e575d93841e555329eb66283c2f1.tar.gz
cpython-cbbf1098f383e575d93841e555329eb66283c2f1.tar.bz2
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://bugs.python.org/issue38809 (cherry picked from commit ee703cbb418b7458bebb1d26a5e19d6b55280b28) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/find_python.bat3
1 files changed, 3 insertions, 0 deletions
diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat
index d5c787f..40937a6 100644
--- a/PCbuild/find_python.bat
+++ b/PCbuild/find_python.bat
@@ -24,6 +24,9 @@
:begin_search
@set PYTHON=
+@rem If there is an active virtual env, use that one
+@if NOT "%VIRTUAL_ENV%"=="" (set PYTHON="%VIRTUAL_ENV%\Scripts\python.exe") & (set _Py_Python_Source=found in virtual env) & goto :found
+
@set _Py_EXTERNALS_DIR=%EXTERNALS_DIR%
@if "%_Py_EXTERNALS_DIR%"=="" (set _Py_EXTERNALS_DIR=%~dp0\..\externals)