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 2014-12-25 17:17 by r.david.murray. 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
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