File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1785,11 +1785,17 @@ public Object globals(VirtualFrame frame) {
1785
1785
abstract static class LocalsNode extends PythonBuiltinNode {
1786
1786
@ Child ReadCallerFrameNode readCallerFrameNode = ReadCallerFrameNode .create ();
1787
1787
@ Child GetLocalsNode getLocalsNode = GetLocalsNode .create ();
1788
+ private final ConditionProfile inGenerator = ConditionProfile .createBinaryProfile ();
1788
1789
1789
1790
@ Specialization
1790
1791
public Object locals (VirtualFrame frame ) {
1791
1792
Frame callerFrame = readCallerFrameNode .executeWith (frame );
1792
- return getLocalsNode .execute (callerFrame );
1793
+ Frame generatorFrame = PArguments .getGeneratorFrame (callerFrame );
1794
+ if (inGenerator .profile (generatorFrame == null )) {
1795
+ return getLocalsNode .execute (callerFrame );
1796
+ } else {
1797
+ return getLocalsNode .execute (generatorFrame );
1798
+ }
1793
1799
}
1794
1800
}
1795
1801
}
You can’t perform that action at this time.
0 commit comments