Skip to content

Commit

Permalink
Problem: missing error handling leads to IndexError
Browse files Browse the repository at this point in the history
Solution: sys.exit when pip install fails
  • Loading branch information
gotcha committed May 18, 2020
1 parent 2a57f19 commit f61090b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/zc/buildout/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,8 +1671,9 @@ def call_pip_install(spec, dest):
logger.error(
"An error occurred when trying to install %s. "
"Look above this message for any errors that "
"were output by easy_install.",
"were output by pip install.",
spec)
sys.exit(1)

split_entries = [os.path.splitext(entry) for entry in os.listdir(dest)]
try:
Expand All @@ -1681,7 +1682,7 @@ def call_pip_install(spec, dest):
][0]
except IndexError:
logger.error(
"No .dist-info directory after installing %s",
"No .dist-info directory after successful pip install of %s",
spec)
raise

Expand Down

0 comments on commit f61090b

Please sign in to comment.