From: Amaury Forgeot d'Arc Date: Fri, 28 Nov 2008 23:28:42 +0000 (+0000) Subject: #4455: IDLE failed to display the windows list when two windows have the same title. X-Git-Tag: v3.0~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47c2b607b8584a5c9e4bd46f53f12fa4fb772d5e;p=python #4455: IDLE failed to display the windows list when two windows have the same title. Windows objects cannot be compared, and it's better to have a consistent order; so We add the window unique ID to the sort key. Reviewed by Benjamin Peterson. --- diff --git a/Lib/idlelib/WindowList.py b/Lib/idlelib/WindowList.py index 761e0155fe..bc74348f56 100644 --- a/Lib/idlelib/WindowList.py +++ b/Lib/idlelib/WindowList.py @@ -26,9 +26,9 @@ class WindowList: title = window.get_title() except TclError: continue - list.append((title, window)) + list.append((title, key, window)) list.sort() - for title, window in list: + for title, key, window in list: menu.add_command(label=title, command=window.wakeup) def register_callback(self, callback): diff --git a/Misc/NEWS b/Misc/NEWS index fe5d84ca4a..8c80bc2856 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -24,6 +24,9 @@ Core and Builtins Library ------- +- Issue #4455: IDLE failed to display the windows list when two windows have + the same title. + - Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception.