From: Guilherme Polo Date: Mon, 9 Feb 2009 16:47:22 +0000 (+0000) Subject: Merged revisions 69463 via svnmerge from X-Git-Tag: v3.0.1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36d7500a98736f187910536bfceec185f3c2b87e;p=thirdparty%2FPython%2Fcpython.git Merged revisions 69463 via svnmerge from svn+ssh://pythondev/python/branches/py3k ................ r69463 | guilherme.polo | 2009-02-09 14:44:24 -0200 (Mon, 09 Feb 2009) | 10 lines Merged revisions 69461 via svnmerge from svn+ssh://pythondev/python/trunk ........ r69461 | guilherme.polo | 2009-02-09 14:41:09 -0200 (Mon, 09 Feb 2009) | 3 lines Fixed issue #4890: Handle empty text search pattern in Tkinter.Text.search ........ ................ --- diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index a6397ea70182..af49170568a3 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -3016,7 +3016,8 @@ class Text(Widget): forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None): """Search PATTERN beginning from INDEX until STOPINDEX. - Return the index of the first character of a match or an empty string.""" + Return the index of the first character of a match or an + empty string.""" args = [self._w, 'search'] if forwards: args.append('-forwards') if backwards: args.append('-backwards') @@ -3025,7 +3026,7 @@ class Text(Widget): if nocase: args.append('-nocase') if elide: args.append('-elide') if count: args.append('-count'); args.append(count) - if pattern[0] == '-': args.append('--') + if pattern and pattern[0] == '-': args.append('--') args.append(pattern) args.append(index) if stopindex: args.append(stopindex) diff --git a/Misc/NEWS b/Misc/NEWS index b737e98a567c..747f4e0fd6e3 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -116,6 +116,8 @@ Core and Builtins Library ------- +- Issue #4890: Handle empty text search pattern in Tkinter.Text.search. + - Partial fix to issue #1731706: memory leak in Tkapp_Call when calling from a thread different than the one that created the Tcl interpreter. Patch by Robert Hancock.