diff options
author | Ned Deily <nad@acm.org> | 2013-07-20 22:08:22 (GMT) |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2013-07-20 22:08:22 (GMT) |
commit | 237e8f5394197253cf3bcb5c76a18577c8081fb6 (patch) | |
tree | 129a843f03530fbcf7cd3d44fcefe6f17e6640e8 | |
parent | 603bd2d374535950720c69efaff04c26c059257e (diff) | |
parent | 8e8b9ba753bf2ada822aff95f19be7a0a85c312e (diff) | |
download | cpython-237e8f5394197253cf3bcb5c76a18577c8081fb6.zip cpython-237e8f5394197253cf3bcb5c76a18577c8081fb6.tar.gz cpython-237e8f5394197253cf3bcb5c76a18577c8081fb6.tar.bz2 |
Issue #17532: merge from 3.3
-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 bdfeb95..18adb84 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') |