[New-bugs-announce] [issue31401] Dynamic compilation that uses function in comprehension fails when compiled inside function

Jose Cambronero report at bugs.python.org
Fri Sep 8 17:19:38 EDT 2017


New submission from Jose Cambronero:

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

----------
files: reproduce.zip
messages: 301734
nosy: jpc
priority: normal
severity: normal
status: open
title: Dynamic compilation that uses function in comprehension fails when compiled inside function
type: compile error
versions: Python 3.6
Added file: https://bugs.python.org/file47127/reproduce.zip

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31401>
_______________________________________


More information about the New-bugs-announce mailing list