diff options
author | Guilherme Polo <ggpolo@gmail.com> | 2009-02-09 16:43:02 (GMT) |
---|---|---|
committer | Guilherme Polo <ggpolo@gmail.com> | 2009-02-09 16:43:02 (GMT) |
commit | 4bf471f4945c35bf8f6c81d1411384c48ecce661 (patch) | |
tree | c8b188f12ab6c895f807fab2a91be0571ebab677 /Lib/lib-tk | |
parent | 4db70f3580c1c1ea2da9ae492bd8b0dfd303788e (diff) | |
download | cpython-4bf471f4945c35bf8f6c81d1411384c48ecce661.zip cpython-4bf471f4945c35bf8f6c81d1411384c48ecce661.tar.gz cpython-4bf471f4945c35bf8f6c81d1411384c48ecce661.tar.bz2 |
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
........
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 8a9d8a4..fded249 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -3032,7 +3032,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') @@ -3041,7 +3042,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) |