Skip to content

Commit d58a291

Browse files
committed
Explicitly return list and convert tcl objects into strings
1 parent fb30d25 commit d58a291

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/tkinter/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4083,7 +4083,12 @@ def search_all(self, pattern, index, stopindex=None, *,
40834083
args.append(index)
40844084
if stopindex: args.append(stopindex)
40854085
result = self.tk.call(tuple(args))
4086-
return list(result.split()) if result else []
4086+
if isinstance(result, tuple):
4087+
return [str(i) for i in result]
4088+
elif isinstance(result, str):
4089+
return result.split()
4090+
else:
4091+
return []
40874092

40884093
def see(self, index):
40894094
"""Scroll such that the character at INDEX is visible."""

0 commit comments

Comments
 (0)