summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/IDE
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-10-12 19:27:24 (GMT)
committerJust van Rossum <just@letterror.com>2003-10-12 19:27:24 (GMT)
commit7e94a9aae3ac7e1d2726dddaac744315313f218a (patch)
tree26a5587c4788a25f75bd90b53c98576a362efbd2 /Mac/Tools/IDE
parent8ae468965700fd9900efc28bff8fa2015dae2bef (diff)
downloadcpython-7e94a9aae3ac7e1d2726dddaac744315313f218a.zip
cpython-7e94a9aae3ac7e1d2726dddaac744315313f218a.tar.gz
cpython-7e94a9aae3ac7e1d2726dddaac744315313f218a.tar.bz2
fix for bug [819860]: make sure the buffer gets emptied, even if WEInsert() fails
Diffstat (limited to 'Mac/Tools/IDE')
-rw-r--r--Mac/Tools/IDE/PyConsole.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Mac/Tools/IDE/PyConsole.py b/Mac/Tools/IDE/PyConsole.py
index e60b138..6f398d1 100644
--- a/Mac/Tools/IDE/PyConsole.py
+++ b/Mac/Tools/IDE/PyConsole.py
@@ -127,10 +127,12 @@ class ConsoleTextWidget(W.EditText):
stuff = string.split(self._buf, '\n')
stuff = string.join(stuff, '\r')
self.setselection_at_end()
- self.ted.WEInsert(stuff, None, None)
+ try:
+ self.ted.WEInsert(stuff, None, None)
+ finally:
+ self._buf = ""
selstart, selend = self.getselection()
self._inputstart = selstart
- self._buf = ""
self.ted.WEClearUndo()
self.updatescrollbars()
if self._parentwindow.wid.GetWindowPort().QDIsPortBuffered():
@@ -329,8 +331,10 @@ class PyOutput:
end = self.w.outputtext.ted.WEGetTextLength()
self.w.outputtext.setselection(end, end)
self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0)
- self.w.outputtext.ted.WEInsert(stuff, None, None)
- self._buf = ""
+ try:
+ self.w.outputtext.ted.WEInsert(stuff, None, None)
+ finally:
+ self._buf = ""
self.w.outputtext.updatescrollbars()
self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1)
if self.w.wid.GetWindowPort().QDIsPortBuffered():