File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 41
41
import com .oracle .graal .python .builtins .objects .object .ObjectBuiltinsFactory .DictNodeFactory ;
42
42
import com .oracle .graal .python .builtins .objects .object .PythonObject ;
43
43
import com .oracle .graal .python .builtins .objects .traceback .PTraceback ;
44
+ import com .oracle .graal .python .nodes .function .ClassBodyRootNode ;
44
45
import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
45
46
import com .oracle .graal .python .nodes .function .PythonBuiltinNode ;
46
47
import com .oracle .graal .python .nodes .function .builtins .PythonUnaryBuiltinNode ;
@@ -171,7 +172,13 @@ Object getFromFrame(Frame owner,
171
172
@ Cached ("create()" ) BranchProfile noFrameOnPFrame ) {
172
173
PFrame pFrame = PArguments .getPFrame (owner );
173
174
if (noPFrame .profile (pFrame == null )) {
174
- pFrame = factory ().createPFrame (owner );
175
+ Object specialArgument = PArguments .getSpecialArgument (owner );
176
+ if (specialArgument instanceof ClassBodyRootNode ) {
177
+ // the namespace argument stores the locals
178
+ pFrame = factory ().createPFrame (owner , PArguments .getArgument (owner , 0 ));
179
+ } else {
180
+ pFrame = factory ().createPFrame (owner );
181
+ }
175
182
PArguments .setPFrame (owner , pFrame );
176
183
} else if (!pFrame .hasFrame ()) {
177
184
noFrameOnPFrame .enter ();
You can’t perform that action at this time.
0 commit comments