Skip to content

Commit 0e3b144

Browse files
authored
fix(install-poetry): check for returncode when pip installing Poetry (#4425)
1 parent 0412085 commit 0e3b144

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

install-poetry.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,9 @@ def _is_self_upgrade_supported(x):
439439
try:
440440
self.install(version)
441441
except subprocess.CalledProcessError as e:
442-
print(colorize("error", "An error has occured: {}".format(str(e))))
443-
print(e.output.decode())
442+
print(
443+
colorize("error", f"\nAn error has occurred: {e}\n{e.stderr.decode()}")
444+
)
444445

445446
return e.returncode
446447

@@ -583,8 +584,8 @@ def install_poetry(self, version: str, env_path: Path) -> None:
583584

584585
subprocess.run(
585586
[str(python), "-m", "pip", "install", specification],
586-
stdout=subprocess.PIPE,
587-
stderr=subprocess.STDOUT,
587+
capture_output=True,
588+
check=True,
588589
)
589590

590591
def display_pre_message(self) -> None:

0 commit comments

Comments
 (0)