New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sysconfig._parse_makefile doesn't expand ${} vars appearing before $() vars #68893
Comments
LIPL has the value and the code relies to substitute parameters from the left to the right, but it prefers $() variables. the attached patch substitutes all variables from the left to the right. diff -r d8229c26dd92 Lib/sysconfig.py
--- a/Lib/sysconfig.py Fri Jul 24 09:05:59 2015 +0300
+++ b/Lib/sysconfig.py Fri Jul 24 14:04:57 2015 +0200
@@ -260,7 +260,12 @@
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 |
Could you please provide an example where unpatched code fails but patched code work? |
On 07/24/2015 03:14 PM, Serhiy Storchaka wrote:
yes, see the substitution for the LIBPL macro, which leaves ${prefix} unexpanded. |
Sorry, I don't understand your example. Could you please provide reproducible Python code? Or better a patch for Lib/test/test_sysconfig.py? |
New changeset ef84d21f5292 by doko in branch '3.5':
|
New changeset dec734dfe2fe by Berker Peksag in branch '3.5': New changeset f9a18032cc22 by Berker Peksag in branch 'default': |
I've added a test case for ef84d21f5292. I think this can be closed now. Please reopen if not. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: