changeset: 84748:db6a22943a3f branch: 3.3 parent: 84745:8b8673ccd3d1 user: Ned Deily date: Sat Jul 20 15:06:26 2013 -0700 files: Lib/idlelib/EditorWindow.py description: Issue #17532: Prevent exception when changing key sets if Options menu is empty. diff -r 8b8673ccd3d1 -r db6a22943a3f Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py Sat Jul 20 22:54:25 2013 +0200 +++ b/Lib/idlelib/EditorWindow.py Sat Jul 20 15:06:26 2013 -0700 @@ -821,7 +821,11 @@ menuEventDict[menu[0]][prepstr(item[0])[1]] = item[1] for menubarItem in self.menudict: menu = self.menudict[menubarItem] - end = menu.index(END) + 1 + end = menu.index(END) + if end is None: + # Skip empty menus + continue + end += 1 for index in range(0, end): if menu.type(index) == 'command': accel = menu.entrycget(index, 'accelerator')