[Python-checkins] cpython (2.7): Issue #24222: Fix regression introduced with idlelib/PyShell.py future print

terry.reedy python-checkins at python.org
Mon May 18 21:37:49 CEST 2015


https://hg.python.org/cpython/rev/cebd51686565
changeset:   96142:cebd51686565
branch:      2.7
parent:      96136:34523e53a342
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Mon May 18 15:37:37 2015 -0400
summary:
  Issue #24222: Fix regression introduced with idlelib/PyShell.py future print
import.  Idle -c "code", -r file.py again compile with print statement.

files:
  Lib/idlelib/PyShell.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -652,7 +652,7 @@
         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'

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list