Skip to content

Commit

Permalink
Assert spinner instead of if condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshks committed Jun 26, 2020
1 parent 36af6f6 commit ecbe065
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pip/_internal/utils/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def call_subprocess(
# Show the line immediately.
log_subprocess(line)
# Update the spinner.
if use_spinner and spinner:
if use_spinner:
assert spinner
spinner.spin()
try:
proc.wait()
Expand All @@ -216,7 +217,8 @@ def call_subprocess(
proc_had_error = (
proc.returncode and proc.returncode not in extra_ok_returncodes
)
if use_spinner and spinner:
if use_spinner:
assert spinner
if proc_had_error:
spinner.finish("error")
else:
Expand Down

0 comments on commit ecbe065

Please sign in to comment.