From 893fe1bc253f70b5aadb26f5468b2de7856136c4 Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Thu, 26 Aug 2021 14:36:08 +0200 Subject: [PATCH] fix(install-poetry): check for returncode when pip installing Poetry (#4425) --- install-poetry.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install-poetry.py b/install-poetry.py index 8dfacb8c5a8..7c9796b8959 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -439,8 +439,9 @@ def _is_self_upgrade_supported(x): try: self.install(version) except subprocess.CalledProcessError as e: - print(colorize("error", "An error has occured: {}".format(str(e)))) - print(e.output.decode()) + print( + colorize("error", f"\nAn error has occurred: {e}\n{e.stderr.decode()}") + ) return e.returncode @@ -583,8 +584,8 @@ def install_poetry(self, version: str, env_path: Path) -> None: subprocess.run( [str(python), "-m", "pip", "install", specification], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, + capture_output=True, + check=True, ) def display_pre_message(self) -> None: