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.

classification
Title: Compiler doesn't recognize qualified exec('', {})
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: "exec(a, b, c)" not the same as "exec a in b, c" in nested functions
View: 21591
Assigned To: Nosy List: johnf
Priority: normal Keywords:

Created on 2014-12-25 17:05 by johnf, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bug.py johnf, 2014-12-25 17:05
Messages (2)
msg233096 - (view) Author: John Firestone (johnf) Date: 2014-12-25 17:05
Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def outer():
...     def inner(arg):
...         len(arg)
...     exec('', {})
... 
  File "<stdin>", line 4
SyntaxError: unqualified exec is not allowed in function 'outer' it contains a nested function with free variables
>>> 
>>> def outer():
...     def inner(arg):
...         len(arg)
...     exec '' in {}
... 
>>>
msg233097 - (view) Author: John Firestone (johnf) Date: 2014-12-25 17:10
Sorry. Duplicates 21591
History
Date User Action Args
2022-04-11 14:58:11adminsetgithub: 67302
2014-12-25 17:17:05r.david.murraysetsuperseder: "exec(a, b, c)" not the same as "exec a in b, c" in nested functions
resolution: duplicate
stage: resolved
2014-12-25 17:10:46johnfsetstatus: open -> closed

messages: + msg233097
2014-12-25 17:05:06johnfcreate