Skip to content

Commit

Permalink
Make sure returncode is actually returned properly
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastProject committed Mar 23, 2017
1 parent 7cbdcd9 commit 5b8fd65
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions pext/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,22 @@ def _pip_install(self, module_dir_name: str) -> int:
# Probably already exists, that's okay
pass

return run([sys.executable,
'-m',
'pip',
'install',
'--system',
'--upgrade',
'--target',
module_dependencies_path,
'-r',
module_requirements_path]).returncode
try:
run([sys.executable,
'-m',
'pip',
'install',
'--system',
'--upgrade',
'--target',
module_dependencies_path,
'-r',
module_requirements_path], check=True)

except CalledProcessError as e:
return e.returncode

return 0

def bind_logger(self, logger: Logger) -> str:
"""Connect a logger to the module manager.
Expand Down

0 comments on commit 5b8fd65

Please sign in to comment.