From 0e3b144488a8a95c73d13a78849244241307af35 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 8dfacb8..7c9796b 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -439,8 +439,9 @@ class Installer: 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 @@ class Installer: 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: