[Python-checkins] r69461 - in python/trunk: Lib/lib-tk/Tkinter.py Misc/NEWS

guilherme.polo python-checkins at python.org
Mon Feb 9 17:41:09 CET 2009


Author: guilherme.polo
Date: Mon Feb  9 17:41:09 2009
New Revision: 69461

Log:
Fixed issue #4890: Handle empty text search pattern in 
Tkinter.Text.search


Modified:
   python/trunk/Lib/lib-tk/Tkinter.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/lib-tk/Tkinter.py
==============================================================================
--- python/trunk/Lib/lib-tk/Tkinter.py	(original)
+++ python/trunk/Lib/lib-tk/Tkinter.py	Mon Feb  9 17:41:09 2009
@@ -3032,7 +3032,8 @@
            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 @@
         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)

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Mon Feb  9 17:41:09 2009
@@ -152,6 +152,8 @@
 Library
 -------
 
+- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
+
 - Issue #5170: Fixed Unicode output bug in logging and added test case.
   This is a regression which did not occur in 2.5.
 


More information about the Python-checkins mailing list