cpython: 0f38948cc6df (original) (raw)

Mercurial > cpython

changeset 78415:0f38948cc6df 3.2

Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog ended with '\'. Patch by Roger Serwy. [#13052]

Andrew Svetlov andrew.svetlov@gmail.com
date Sat, 04 Aug 2012 21:38:22 +0300
parents 66b53f555704
children 9dcfba4d0357 4efad7fba42a
files Lib/idlelib/ReplaceDialog.py Misc/NEWS
diffstat 2 files changed, 29 insertions(+), 5 deletions(-)[+] [-] Lib/idlelib/ReplaceDialog.py 31 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/idlelib/ReplaceDialog.py +++ b/Lib/idlelib/ReplaceDialog.py @@ -2,6 +2,8 @@ from tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase +import re + def replace(text): root = text._root() @@ -11,6 +13,7 @@ def replace(text): dialog = engine._replacedialog dialog.open(text) + class ReplaceDialog(SearchDialogBase): title = "Replace Dialog" @@ -55,8 +58,23 @@ class ReplaceDialog(SearchDialogBase): def default_command(self, event=None): if self.do_find(self.ok):

+

+

def replace_all(self, event=None): prog = self.engine.getprog() @@ -86,7 +104,9 @@ class ReplaceDialog(SearchDialogBase): line, m = res chars = text.get("%d.0" % line, "%d.0" % (line+1)) orig = m.group()

@@ -103,7 +123,6 @@ class ReplaceDialog(SearchDialogBase): text.undo_block_stop() if first and last: self.show_hit(first, last)

def do_find(self, ok=0): if not self.engine.getprog(): @@ -138,7 +157,9 @@ class ReplaceDialog(SearchDialogBase): m = prog.match(chars, col) if not prog: return False

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -101,6 +101,9 @@ Core and Builtins Library ------- +- Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog