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

Skip to content

Commit 8e8b9ba

Browse files
committed
Issue #17532: Prevent exception when changing key sets if Options menu is empty.
1 parent a6404ad commit 8e8b9ba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/idlelib/EditorWindow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,11 @@ def ApplyKeybindings(self):
821821
menuEventDict[menu[0]][prepstr(item[0])[1]] = item[1]
822822
for menubarItem in self.menudict:
823823
menu = self.menudict[menubarItem]
824-
end = menu.index(END) + 1
824+
end = menu.index(END)
825+
if end is None:
826+
# Skip empty menus
827+
continue
828+
end += 1
825829
for index in range(0, end):
826830
if menu.type(index) == 'command':
827831
accel = menu.entrycget(index, 'accelerator')

0 commit comments

Comments
 (0)