Skip to content

Commit 91f60a9

Browse files
committed
Add regression test for RustPython#4505
1 parent 5a5b721 commit 91f60a9

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
https://github.com/RustPython/RustPython/issues/4505
3+
"""
4+
5+
def foo():
6+
def inner():
7+
pass
8+
9+
assert foo.__code__.co_names == ()
10+
11+
stmts = """
12+
import blah
13+
14+
def foo():
15+
pass
16+
"""
17+
18+
code = compile(stmts, "<test>", "exec")
19+
assert code.co_names == ("blah", "foo")

0 commit comments

Comments
 (0)