diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-21 01:54:26 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-21 01:54:26 +0200 |
commit | 8e0908495a0588cee8620a7a8081f9b17b930baf (patch) | |
tree | 4a3e30b5f494767d5179ab28522d192e8c70ddf2 | |
parent | 8c077bc03e3d69404e826a45f5add1f08b85d9a7 (diff) | |
parent | 8e8b9ba753bf2ada822aff95f19be7a0a85c312e (diff) | |
download | cpython-git-8e0908495a0588cee8620a7a8081f9b17b930baf.tar.gz |
merge
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index fd2f11dadd..24f133fa9b 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -821,7 +821,11 @@ class EditorWindow(object): 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') |