mirror of
https://github.com/python/cpython.git
synced 2026-01-26 01:02:13 +00:00
Fixed issue #4890: Handle empty text search pattern in
Tkinter.Text.search
This commit is contained in:
parent
190c35f928
commit
d2ea0332ab
2 changed files with 5 additions and 2 deletions
|
|
@ -3032,7 +3032,8 @@ def search(self, pattern, index, stopindex=None,
|
|||
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 @@ def search(self, pattern, index, stopindex=None,
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -152,6 +152,8 @@ Core and Builtins
|
|||
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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue