]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #24222: Fix regression introduced with idlelib/PyShell.py future print
authorTerry Jan Reedy <tjreedy@udel.edu>
Mon, 18 May 2015 19:37:37 +0000 (15:37 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Mon, 18 May 2015 19:37:37 +0000 (15:37 -0400)
import.  Idle -c "code", -r file.py again compile with print statement.

Lib/idlelib/PyShell.py

index 8ee0c0e7466e972db2e403022789f44d204bd677..eec59789eee68d3615b680fb4597f59623bf2684 100755 (executable)
@@ -652,7 +652,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
         if source is None:
             source = open(filename, "r").read()
         try:
-            code = compile(source, filename, "exec")
+            code = compile(source, filename, "exec", dont_inherit=True)
         except (OverflowError, SyntaxError):
             self.tkconsole.resetoutput()
             print('*** Error in script or command!\n'