summaryrefslogtreecommitdiff
path: root/PCbuild
diff options
context:
space:
mode:
authorTal Einat <taleinat+github@gmail.com>2019-11-18 19:32:25 +0200
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-11-18 09:32:25 -0800
commitee703cbb418b7458bebb1d26a5e19d6b55280b28 (patch)
treea61f3878a1c985a944aff47820545c0d53f4b9d8 /PCbuild
parentbc7d3aa6d74b718699b7a6bced9b0dfdfbf95c13 (diff)
downloadcpython-git-ee703cbb418b7458bebb1d26a5e19d6b55280b28.tar.gz
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://bugs.python.org/issue38809
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 d5c787fd77..40937a67c3 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)