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) {
7676
7777 @ Override
7878 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 ) {
8280 ctx .scope = environment .pushScope (ctx , ScopeInfo .ScopeKind .Function , curInlineLocals );
81+ } else {
82+ ctx .scope = environment .pushScope (ctx , ScopeInfo .ScopeKind .Module );
8383 }
8484 try {
8585 return super .visitSingle_input (ctx );
8686 } finally {
87- if (interactive || curInlineLocals != null ) {
88- environment .popScope ();
89- }
87+ environment .popScope ();
9088 }
9189 }
9290
You can’t perform that action at this time.
0 commit comments