From 9cdfac4454c31e3075f79c8d31d5e74fedaa4205 Mon Sep 17 00:00:00 2001 From: Konstantin Kopachev Date: Fri, 6 Jul 2018 17:07:19 -0700 Subject: [PATCH] Capture pkg-config output even if only one component returned Changing pkg-config output parser in case it returns only one component (only -I or only -L) --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9529787f9..99e43cec9 100755 --- a/setup.py +++ b/setup.py @@ -154,8 +154,8 @@ def _pkg_config(name): ] if not DEBUG: command.append('--silence-errors') - libs = subprocess.check_output(command).decode('utf8').split(' ') - return libs[1][2:].strip(), libs[0][2:].strip() + libs = subprocess.check_output(command).decode('utf8') + return re.match(r'(?:-L([^\s]+))?\s*(?:-I([^\s]+))?', libs).groups() except Exception: pass