Skip to content

Commit efa26bc

Browse files
authored
bpo-30450: Fall back to git.exe if no Python is found. (#2739)
* bpo-30450: Fall back to git.exe if no Python is found. * Also check whether git.exe is on PATH if it will be used.
1 parent 588836d commit efa26bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

PCbuild/get_externals.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ if "%DO_FETCH%"=="false" goto end
4141
if "%ORG%"=="" (set ORG=python)
4242
call "%PCBUILD%find_python.bat" "%PYTHON%"
4343

44+
if "%PYTHON%"=="" (
45+
where /Q git || echo Python 3.6 could not be found or installed, and git.exe is not on your PATH && exit /B 1
46+
)
47+
4448
echo.Fetching external libraries...
4549

4650
set libraries=
@@ -55,6 +59,9 @@ set libraries=%libraries% xz-5.2.2
5559
for %%e in (%libraries%) do (
5660
if exist "%EXTERNALS_DIR%\%%e" (
5761
echo.%%e already exists, skipping.
62+
) else if "%PYTHON%"=="" (
63+
echo.Fetching %%e with git...
64+
git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e"
5865
) else (
5966
echo.Fetching %%e...
6067
%PYTHON% "%PCBUILD%get_external.py" -O %ORG% %%e
@@ -71,6 +78,9 @@ if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06
7178
for %%b in (%binaries%) do (
7279
if exist "%EXTERNALS_DIR%\%%b" (
7380
echo.%%b already exists, skipping.
81+
) else if "%PYTHON%"=="" (
82+
echo.Fetching %%b with git...
83+
git clone --depth 1 https://github.com/%ORG%/cpython-bin-deps --branch %%b "%EXTERNALS_DIR%\%%b"
7484
) else (
7585
echo.Fetching %%b...
7686
%PYTHON% "%PCBUILD%get_external.py" -b -O %ORG% %%b

0 commit comments

Comments
 (0)