From 7b493c684aece2dc3e4f233fe044f23c1606be95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <2642849+elopez@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:58:50 -0300 Subject: [PATCH] Do not capture solc output (#130) We want solc stdout and stderr to go to the corresponding streams, so just leave them connected when invoking the underlying solc binary. --- solc_select/__main__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/solc_select/__main__.py b/solc_select/__main__.py index 234c36e..d4496c7 100644 --- a/solc_select/__main__.py +++ b/solc_select/__main__.py @@ -83,13 +83,11 @@ def solc() -> None: path = ARTIFACTS_DIR.joinpath(f"solc-{version}", f"solc-{version}") halt_old_architecture(path) try: - # Display solc usage when invoked with help flag or without options - check_process = sys.argv[1:] not in ["--help", []] - process = subprocess.run( - [str(path)] + sys.argv[1:], stdout=subprocess.PIPE, stdin=None, check=check_process + subprocess.run( + [str(path)] + sys.argv[1:], + check=True, ) - print(str(process.stdout, "utf-8")) - except subprocess.CalledProcessError: - sys.exit(1) + except subprocess.CalledProcessError as e: + sys.exit(e.returncode) else: sys.exit(1)