Xavier de Gaye added the comment:

The NameError exception occuring on a generator expression referencing a local 
variable when the generator is called within exec() is the object of multiple 
entries in the bug tracker, see issue 13557.

msg 149096 in this issue suggests using exec(code, locals()) to fix the 
problem. It seems that what does currently the do_interact() method, and what 
is proposed in the patch is the recommended practice to handle this problem.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21161>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to