Skip to content

Commit c0b4c82

Browse files
committed
bpo-30450: Fall back to git.exe if no Python is found. (python#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 7195303 commit c0b4c82

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎PCbuild/get_externals.bat‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ if "%PYTHON_FOR_BUILD%"=="" (
5151
set PYTHON_FOR_BUILD="%EXTERNALS_DIR%\pythonx86\tools\python.exe"
5252
)
5353

54+
if "%PYTHON%"=="" (
55+
where /Q git || echo Python 3.6 could not be found or installed, and git.exe is not on your PATH && exit /B 1
56+
)
57+
5458
echo.Fetching external libraries...
5559

5660
set libraries=
@@ -65,6 +69,9 @@ set libraries=%libraries% xz-5.2.2
6569
for %%e in (%libraries%) do (
6670
if exist "%EXTERNALS_DIR%\%%e" (
6771
echo.%%e already exists, skipping.
72+
) else if "%PYTHON%"=="" (
73+
echo.Fetching %%e with git...
74+
git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e"
6875
) else (
6976
echo.Fetching %%e...
7077
%PYTHON_FOR_BUILD% "%PCBUILD%get_external.py" -O %ORG% %%e
@@ -80,6 +87,9 @@ if NOT "%IncludeSSL%"=="false" set binaries=%binaries% nasm-2.11.06
8087
for %%b in (%binaries%) do (
8188
if exist "%EXTERNALS_DIR%\%%b" (
8289
echo.%%b already exists, skipping.
90+
) else if "%PYTHON%"=="" (
91+
echo.Fetching %%b with git...
92+
git clone --depth 1 https://github.com/%ORG%/cpython-bin-deps --branch %%b "%EXTERNALS_DIR%\%%b"
8393
) else (
8494
echo.Fetching %%b...
8595
%PYTHON_FOR_BUILD% "%PCBUILD%get_external.py" -b -O %ORG% %%b

0 commit comments

Comments
 (0)