Skip to content

Commit e4e2530

Browse files
check ensurepip exit code in Windows installer
Add error handling for ensurepip execution and pip installation.
1 parent 5c33d08 commit e4e2530

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

installers/win-setup-template.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ $PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
141141
cmd.exe /c "$PythonExePath -c ""import pip"""
142142
if ($LASTEXITCODE -ne 0) {
143143
cmd.exe /c "$PythonExePath -m ensurepip"
144+
if ($LASTEXITCODE -ne 0) {
145+
Throw "Error happened during ensurepip execution"
146+
}
144147
}
145148
cmd.exe /c "$PythonExePath -m pip install --upgrade --force-reinstall pip --no-warn-script-location"
146149
if ($LASTEXITCODE -ne 0) {

0 commit comments

Comments
 (0)