File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -76,17 +76,15 @@ public T visitFile_input(Python3Parser.File_inputContext ctx) {
76
76
77
77
@ Override
78
78
public T visitSingle_input (Single_inputContext ctx ) {
79
- if (interactive ) {
80
- ctx .scope = environment .pushScope (ctx , ScopeInfo .ScopeKind .Module );
81
- } else if (curInlineLocals != null ) {
79
+ if (!interactive && curInlineLocals != null ) {
82
80
ctx .scope = environment .pushScope (ctx , ScopeInfo .ScopeKind .Function , curInlineLocals );
81
+ } else {
82
+ ctx .scope = environment .pushScope (ctx , ScopeInfo .ScopeKind .Module );
83
83
}
84
84
try {
85
85
return super .visitSingle_input (ctx );
86
86
} finally {
87
- if (interactive || curInlineLocals != null ) {
88
- environment .popScope ();
89
- }
87
+ environment .popScope ();
90
88
}
91
89
}
92
90
You can’t perform that action at this time.
0 commit comments