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 jpc
Recipients jpc
Date 2017-09-08.21:19:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504905578.93.0.552234464993.issue31401@psf.upfronthosting.co.za>
In-reply-to
Content
Execution fails with NameError when trying to dynamically compile a Python program that uses a function in a comprehension, and the code is compiled inside a function call, rather than as a global statement.

Using the attached files to reproduce (in reproduce.zip):

python3 compile_in_function.py comprehension.py #fails
python3 compile_global.py comprehension.py # works
python2 compile_in_function.py comprehension.py #works with Python 2.7.12
History
Date User Action Args
2017-09-08 21:19:38jpcsetrecipients: + jpc
2017-09-08 21:19:38jpcsetmessageid: <1504905578.93.0.552234464993.issue31401@psf.upfronthosting.co.za>
2017-09-08 21:19:38jpclinkissue31401 messages
2017-09-08 21:19:38jpccreate