(Merge 3.2) Issue #12070: Fix the Makefile parser of the sysconfig module to

handle correctly references to "bogus variable" (e.g. "prefix=$/opt/python").
This commit is contained in:
Victor Stinner 2011-05-24 23:38:03 +02:00
commit 17dc81951a
3 changed files with 31 additions and 12 deletions

View file

@ -287,14 +287,16 @@ def _parse_makefile(filename, vars=None):
variables.remove(name)
if name.startswith('PY_') \
and name[3:] in renamed_variables:
and name[3:] in renamed_variables:
name = name[3:]
if name not in done:
done[name] = value
else:
# bogus variable reference; just drop it since we can't deal
# bogus variable reference (e.g. "prefix=$/opt/python");
# just drop it since we can't deal
done[name] = value
variables.remove(name)
# strip spurious spaces