summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2013-07-20 21:38:24 (GMT)
committerNed Deily <nad@acm.org>2013-07-20 21:38:24 (GMT)
commit14ef0c8d6bb1794910e815fb3c61d22cc966a49e (patch)
treea7cda92785caa80bfec8d8c5c82d95282bc8e4e5 /Lib/idlelib/EditorWindow.py
parent69468146b4ed8a92d63b22c91db7c1832dd49a78 (diff)
downloadcpython-14ef0c8d6bb1794910e815fb3c61d22cc966a49e.zip
cpython-14ef0c8d6bb1794910e815fb3c61d22cc966a49e.tar.gz
cpython-14ef0c8d6bb1794910e815fb3c61d22cc966a49e.tar.bz2
Issue #17532: Prevent exception when changing key sets if Options menu is empty.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 14c76de..5de53a9 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -833,7 +833,11 @@ class EditorWindow(object):
menuEventDict[menu[0]][prepstr(item[0])[1]] = item[1]
for menubarItem in self.menudict.keys():
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')