This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jedbrown
Recipients Arfrever, brett.cannon, eric.araujo, jedbrown, jyasskin, lemburg, loewis, mark.dickinson, pitrou, ronaldoussoren, rpetrov, skrah, tarek
Date 2013-05-20.15:04:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369062259.2.0.834228669082.issue9189@psf.upfronthosting.co.za>
In-reply-to
Content
Undefined variables are still a problem:

$ echo 'FROTZ = ${CFLAGS}' > make.py3
$ python3
Python 3.3.1 (default, Apr  6 2013, 19:03:55) 
[GCC 4.8.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils.sysconfig
>>> distutils.sysconfig.parse_makefile('make.py3')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.3/distutils/sysconfig.py", line 367, in parse_makefile
    item = str(done['PY_' + n])
KeyError: 'PY_CFLAGS'

Proposed fix:

--- i/Lib/distutils/sysconfig.py
+++ w/Lib/distutils/sysconfig.py
@@ -357,7 +357,7 @@ def parse_makefile(fn, g=None):
                         found = False
 
                     else:
-                        item = str(done['PY_' + n])
+                        item = str(done.get('PY_' + n, ''))
                 else:
                     done[n] = item = ""
                 if found:
History
Date User Action Args
2013-05-20 15:04:19jedbrownsetrecipients: + jedbrown, lemburg, loewis, brett.cannon, ronaldoussoren, mark.dickinson, pitrou, jyasskin, tarek, eric.araujo, rpetrov, Arfrever, skrah
2013-05-20 15:04:19jedbrownsetmessageid: <1369062259.2.0.834228669082.issue9189@psf.upfronthosting.co.za>
2013-05-20 15:04:19jedbrownlinkissue9189 messages
2013-05-20 15:04:19jedbrowncreate