Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment: self.deletecommand doesn't remove menu item, so we don't have to care about index shifting like bellow. +1 for gpolo's patch.
>>> a = [0, 1, 2, 3] >>> for i in xrange(len(a)): ... del a[i] ... Traceback (most recent call last): File "<stdin>", line 2, in <module> IndexError: list assignment index out of range I'm not sure (self._tclCommands is not None) check is not really needed. I was looking for the place self._tclCommands is initialized, and found _register() is that place, but what is 'needcleanup'? :-0 But probably, gpolo's patch is right. P.S. This is not related to this issue, I think """Delete menu items between INDEX1 and INDEX2 (not included).""" should be changed to """Delete menu items between INDEX1 and INDEX2 (included).""" Please look at http://www.tcl.tk/man/tcl8.5/TkCmd/menu.htm#M59 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3774> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com