File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 11import types
2- from testutils import assert_raises
32
3+ from testutils import assert_raises
44
55# Spec: https://docs.python.org/2/library/types.html
66print (None )
@@ -111,8 +111,6 @@ class D:
111111with assert_raises (TypeError ):
112112 del int .__qualname__
113113
114- from testutils import assert_raises
115-
116114import platform
117115
118116if platform .python_implementation () == "RustPython" :
@@ -607,3 +605,24 @@ class A(type):
607605
608606
609607assert "__dict__" not in A .__dict__
608+
609+
610+ # regression tests for: https://github.com/RustPython/RustPython/issues/4505
611+
612+
613+ def foo ():
614+ def inner ():
615+ pass
616+
617+
618+ assert foo .__code__ .co_names == ()
619+
620+ stmts = """
621+ import blah
622+
623+ def foo():
624+ pass
625+ """
626+
627+ code = compile (stmts , "<test>" , "exec" )
628+ assert code .co_names == ("blah" , "foo" )
You can’t perform that action at this time.
0 commit comments