]> granicus.if.org Git - python/commitdiff
#13039 allow proper deletion of '>>> ' in IDLE editor windows.
authorTerry Jan Reedy <tjreedy@udel.edu>
Mon, 16 Jan 2012 00:02:50 +0000 (19:02 -0500)
committerTerry Jan Reedy <tjreedy@udel.edu>
Mon, 16 Jan 2012 00:02:50 +0000 (19:02 -0500)
Patch by Roger Serwy.

Lib/idlelib/EditorWindow.py

index f16badb90e2d33b27e4fa448e776b3a78ac16494..1230047ed2b16d211d5c9fd9fa7da56c0c53a199 100644 (file)
@@ -1135,7 +1135,10 @@ class EditorWindow(object):
         assert have > 0
         want = ((have - 1) // self.indentwidth) * self.indentwidth
         # Debug prompt is multilined....
-        last_line_of_prompt = sys.ps1.split('\n')[-1]
+        if self.context_use_ps1:
+            last_line_of_prompt = sys.ps1.split('\n')[-1]
+        else:
+            last_line_of_prompt = ''
         ncharsdeleted = 0
         while 1:
             if chars == last_line_of_prompt: