From 968eab3d11a99198dd0837a3d02ca5e63d547a19 Mon Sep 17 00:00:00 2001 From: Cheryl Sabella Date: Sat, 26 Aug 2017 12:57:46 -0400 Subject: [PATCH] bpo-31284: IDLE: Fix WindowList warning message when running tests --- Lib/idlelib/editor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 43b105f726573d1..f639a27dd0bf7c7 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -388,7 +388,10 @@ def createmenubar(self): def postwindowsmenu(self): # Only called when Windows menu exists menu = self.menudict['windows'] - end = menu.index("end") + try: + end = menu.index("end") + except TclError: + return if end is None: end = -1 if end > self.wmenu_end: