From e2f61371c67a614ae7f7b1c67a187373a8191153 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 29 Jan 2023 19:43:13 +1100 Subject: [PATCH] Always redirect pkg-config stderr to DEVNULL --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 4382c1a97..75f3224f4 100755 --- a/setup.py +++ b/setup.py @@ -255,23 +255,21 @@ def _pkg_config(name): try: command_libs = [command, "--libs-only-L", name] command_cflags = [command, "--cflags-only-I", name] - stderr = None if keep_system: command_libs.append("--keep-system-libs") command_cflags.append("--keep-system-cflags") - stderr = subprocess.DEVNULL if not DEBUG: command_libs.append("--silence-errors") command_cflags.append("--silence-errors") libs = re.split( r"(^|\s+)-L", - subprocess.check_output(command_libs, stderr=stderr) + subprocess.check_output(command_libs, stderr=subprocess.DEVNULL) .decode("utf8") .strip(), )[::2][1:] cflags = re.split( r"(^|\s+)-I", - subprocess.check_output(command_cflags, stderr=stderr) + subprocess.check_output(command_cflags, stderr=subprocess.DEVNULL) .decode("utf8") .strip(), )[::2][1:]