[Python-checkins] cpython (merge 3.5 -> default): Merge with 3.5

terry.reedy python-checkins at python.org
Sat Aug 1 04:36:11 CEST 2015


https://hg.python.org/cpython/rev/91c613d04698
changeset:   97177:91c613d04698
parent:      97173:74fc1af57c72
parent:      97176:7ce13edf8b0b
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Fri Jul 31 22:35:15 2015 -0400
summary:
  Merge with 3.5

files:
  Lib/idlelib/PyShell.py       |  13 ++++++-------
  Lib/idlelib/ScriptBinding.py |   2 +-
  Misc/ACKS                    |   1 +
  3 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -469,7 +469,7 @@
         self.poll_subprocess()
         return self.rpcclt
 
-    def restart_subprocess(self, with_cwd=False):
+    def restart_subprocess(self, with_cwd=False, filename=''):
         if self.restarting:
             return self.rpcclt
         self.restarting = True
@@ -497,14 +497,13 @@
         console.stop_readline()
         # annotate restart in shell window and mark it
         console.text.delete("iomark", "end-1c")
-        if was_executing:
-            console.write('\n')
-            console.showprompt()
-        halfbar = ((int(console.width) - 16) // 2) * '='
-        console.write(halfbar + ' RESTART ' + halfbar)
+        tag = 'RUN ' + filename if filename else 'RESTART Shell'
+        halfbar = ((int(console.width) -len(tag) - 4) // 2) * '='
+        console.write("\n{0} {1} {0}".format(halfbar, tag))
         console.text.mark_set("restart", "end-1c")
         console.text.mark_gravity("restart", "left")
-        console.showprompt()
+        if not filename:
+            console.showprompt()
         # restart subprocess debugger
         if debug:
             # Restarted debugger connects to current instance of debug GUI
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py
--- a/Lib/idlelib/ScriptBinding.py
+++ b/Lib/idlelib/ScriptBinding.py
@@ -142,7 +142,7 @@
             return 'break'
         interp = self.shell.interp
         if PyShell.use_subprocess:
-            interp.restart_subprocess(with_cwd=False)
+            interp.restart_subprocess(with_cwd=False, filename=code.co_filename)
         dirname = os.path.dirname(filename)
         # XXX Too often this discards arguments the user just set...
         interp.runcommand("""if 1:
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1443,6 +1443,7 @@
 Doobee R. Tzeck
 Eren Türkay
 Lionel Ulmer
+Adnan Umer
 Roger Upole
 Daniel Urban
 Michael Urman

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


More information about the Python-checkins mailing list