Closed as not planned
Description
Bug report
A clear and concise description of what the bug is.
Include a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example), if possible.
With following code, f1 is OK, but f2 failed with the error "name 'a' is not defined"
def f1():
a = "hello"
exec("print(a)")
def f2():
a = "hello"
exec("def inner(): print(a)\ninner()")
f1()
f2()
Your environment
-
CPython versions tested on:
Python 3.5.2 (default, Aug 10 2017, 23:51:58)
[GCC 4.4.3] on linux -
Operating system and architecture:
Linux 3.10.0-1160.25.1.el7.x86_64

