]> granicus.if.org Git - python/commitdiff
- Issue #24705: Fix sysconfig._parse_makefile not expanding ${} vars
authordoko@ubuntu.com <doko@ubuntu.com>
Mon, 11 Jan 2016 20:41:40 +0000 (21:41 +0100)
committerdoko@ubuntu.com <doko@ubuntu.com>
Mon, 11 Jan 2016 20:41:40 +0000 (21:41 +0100)
  appearing before $() vars.

Lib/sysconfig.py
Misc/NEWS

index 137932ef784688ede8938f1ce9cf8d24945cee67..9c34be0a07e2f16f6e9e50a13d4fbb9423343f28 100644 (file)
@@ -260,7 +260,12 @@ def _parse_makefile(filename, vars=None):
     while len(variables) > 0:
         for name in tuple(variables):
             value = notdone[name]
-            m = _findvar1_rx.search(value) or _findvar2_rx.search(value)
+            m1 = _findvar1_rx.search(value)
+            m2 = _findvar2_rx.search(value)
+            if m1 and m2:
+                m = m1 if m1.start() < m2.start() else m2
+            else:
+                m = m1 if m1 else m2
             if m is not None:
                 n = m.group(1)
                 found = True
index 7bdce713012c00b8274bd8d55cb84f0442925395..20d8bb2e0de6bd5a19c14d89de2731ff77c727ad 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -44,6 +44,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #24705: Fix sysconfig._parse_makefile not expanding ${} vars
+  appearing before $() vars.
+
 - Issue #22138: Fix mock.patch behavior when patching descriptors. Restore
   original values after patching. Patch contributed by Sean McCully.