Merge pull request #6261 from radarhere/stderr

Hide stderr from --keep-system-libs
This commit is contained in:
Hugo van Kemenade 2022-05-04 16:22:52 +03:00 committed by GitHub
commit e42d8b0890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,14 +255,16 @@ def _pkg_config(name):
try: try:
command_libs = [command, "--libs-only-L", name] command_libs = [command, "--libs-only-L", name]
command_cflags = [command, "--cflags-only-I", name] command_cflags = [command, "--cflags-only-I", name]
stderr = None
if keep_system: if keep_system:
command_libs.append("--keep-system-libs") command_libs.append("--keep-system-libs")
command_cflags.append("--keep-system-cflags") command_cflags.append("--keep-system-cflags")
stderr = subprocess.DEVNULL
if not DEBUG: if not DEBUG:
command_libs.append("--silence-errors") command_libs.append("--silence-errors")
command_cflags.append("--silence-errors") command_cflags.append("--silence-errors")
libs = ( libs = (
subprocess.check_output(command_libs) subprocess.check_output(command_libs, stderr=stderr)
.decode("utf8") .decode("utf8")
.strip() .strip()
.replace("-L", "") .replace("-L", "")