Skip to content

Commit

Permalink
Addon Manager: Error checking when Python can't be found
Browse files Browse the repository at this point in the history
  • Loading branch information
chennes committed Oct 3, 2022
1 parent 8cbf978 commit 14cf777
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Mod/AddonManager/manage_python_dependencies.py
Expand Up @@ -77,9 +77,9 @@ def call_pip(args) -> List[str]:
python_exe = utils.get_python_exe()
pip_failed = False
if python_exe:
call_args = [python_exe, "-m", "pip", "--disable-pip-version-check"]
call_args.extend(args)
try:
call_args = [python_exe, "-m", "pip", "--disable-pip-version-check"]
call_args.extend(args)
proc = subprocess.run(
call_args,
stdout=subprocess.PIPE,
Expand All @@ -101,15 +101,15 @@ def call_pip(args) -> List[str]:
)
FreeCAD.Console.PrintLog(" ".join(call_args))
pip_failed = True
else:
pip_failed = True

result = []
if not pip_failed:
data = proc.stdout.decode()
result = data.split("\n")
result = []
if not pip_failed:
data = proc.stdout.decode()
result = data.split("\n")
else:
raise Exception(proc.stderr.decode())
else:
raise Exception(proc.stderr.decode())
raise Exception("Could not locate Python executable on this system")
return result


Expand Down

0 comments on commit 14cf777

Please sign in to comment.