Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffeef90

Browse files
author
Robert Schuppenies
committed
Merged revisions 65971 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r65971 | robert.schuppenies | 2008-08-22 10:03:43 +0200 (Fri, 22 Aug 2008) | 2 lines Issue #1342811: Fixed broken patch. Reviewed by benjamin.peterson. ........
1 parent 6b84b6c commit ffeef90

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Lib/tkinter/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,11 +2654,13 @@ def delete(self, index1, index2=None):
26542654
if index2 is None:
26552655
index2 = index1
26562656
cmds = []
2657-
for i in range(self.index(index1), self.index(index2)+1):
2658-
if 'command' in self.entryconfig(i):
2659-
c = str(self.entrycget(i, 'command'))
2660-
if c in self._tclCommands:
2661-
cmds.append(c)
2657+
(num_index1, num_index2) = (self.index(index1), self.index(index2))
2658+
if (num_index1 is not None) and (num_index2 is not None):
2659+
for i in range(num_index1, num_index2 + 1):
2660+
if 'command' in self.entryconfig(i):
2661+
c = str(self.entrycget(i, 'command'))
2662+
if c in self._tclCommands:
2663+
cmds.append(c)
26622664
self.tk.call(self._w, 'delete', index1, index2)
26632665
for c in cmds:
26642666
self.deletecommand(c)

0 commit comments

Comments
 (0)