summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/__init__.py
diff options
context:
space:
mode:
authorGuilherme Polo <ggpolo@gmail.com>2009-02-09 16:44:24 (GMT)
committerGuilherme Polo <ggpolo@gmail.com>2009-02-09 16:44:24 (GMT)
commitae09899fa39bc0b9a4b79b236aa98bd5f1475134 (patch)
tree11709bbb53fddf1eae3eac1817971b93a6bc4318 /Lib/tkinter/__init__.py
parentee1ae7ccb76b9ae81ae2c4e9c04ce71d7b605038 (diff)
downloadcpython-ae09899fa39bc0b9a4b79b236aa98bd5f1475134.zip
cpython-ae09899fa39bc0b9a4b79b236aa98bd5f1475134.tar.gz
cpython-ae09899fa39bc0b9a4b79b236aa98bd5f1475134.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/tkinter/__init__.py')
-rw-r--r--Lib/tkinter/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index a6397ea..af49170 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)