mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
fix for bug [819860]: make sure the buffer gets emptied, even if WEInsert() fails
This commit is contained in:
parent
8ae4689657
commit
7e94a9aae3
1 changed files with 8 additions and 4 deletions
|
@ -127,10 +127,12 @@ class ConsoleTextWidget(W.EditText):
|
||||||
stuff = string.split(self._buf, '\n')
|
stuff = string.split(self._buf, '\n')
|
||||||
stuff = string.join(stuff, '\r')
|
stuff = string.join(stuff, '\r')
|
||||||
self.setselection_at_end()
|
self.setselection_at_end()
|
||||||
self.ted.WEInsert(stuff, None, None)
|
try:
|
||||||
|
self.ted.WEInsert(stuff, None, None)
|
||||||
|
finally:
|
||||||
|
self._buf = ""
|
||||||
selstart, selend = self.getselection()
|
selstart, selend = self.getselection()
|
||||||
self._inputstart = selstart
|
self._inputstart = selstart
|
||||||
self._buf = ""
|
|
||||||
self.ted.WEClearUndo()
|
self.ted.WEClearUndo()
|
||||||
self.updatescrollbars()
|
self.updatescrollbars()
|
||||||
if self._parentwindow.wid.GetWindowPort().QDIsPortBuffered():
|
if self._parentwindow.wid.GetWindowPort().QDIsPortBuffered():
|
||||||
|
@ -329,8 +331,10 @@ class PyOutput:
|
||||||
end = self.w.outputtext.ted.WEGetTextLength()
|
end = self.w.outputtext.ted.WEGetTextLength()
|
||||||
self.w.outputtext.setselection(end, end)
|
self.w.outputtext.setselection(end, end)
|
||||||
self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0)
|
self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0)
|
||||||
self.w.outputtext.ted.WEInsert(stuff, None, None)
|
try:
|
||||||
self._buf = ""
|
self.w.outputtext.ted.WEInsert(stuff, None, None)
|
||||||
|
finally:
|
||||||
|
self._buf = ""
|
||||||
self.w.outputtext.updatescrollbars()
|
self.w.outputtext.updatescrollbars()
|
||||||
self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1)
|
self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1)
|
||||||
if self.w.wid.GetWindowPort().QDIsPortBuffered():
|
if self.w.wid.GetWindowPort().QDIsPortBuffered():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue