Addon Manager: Fix undeclared variable in error handling

This commit is contained in:
Chris Hennes
2022-10-03 12:54:25 -05:00
parent 0edb57d205
commit 735b786cb3

View File

@@ -79,6 +79,7 @@ def call_pip(args) -> List[str]:
if python_exe:
call_args = [python_exe, "-m", "pip", "--disable-pip-version-check"]
call_args.extend(args)
proc = None
try:
proc = subprocess.run(
call_args,
@@ -106,8 +107,10 @@ def call_pip(args) -> List[str]:
if not pip_failed:
data = proc.stdout.decode()
result = data.split("\n")
else:
elif proc:
raise Exception(proc.stderr.decode())
else:
raise Exception("pip timed out")
else:
raise Exception("Could not locate Python executable on this system")
return result