]> granicus.if.org Git - python/commitdiff
#4455: IDLE failed to display the windows list when two windows have the same title.
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Fri, 28 Nov 2008 23:28:42 +0000 (23:28 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Fri, 28 Nov 2008 23:28:42 +0000 (23:28 +0000)
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.

Lib/idlelib/WindowList.py
Misc/NEWS

index 761e0155feacfd05441bfe36eb7002e89ad5ff62..bc74348f569c95a1c9d3ebab2de1d28a38ff0ac2 100644 (file)
@@ -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):
index fe5d84ca4acebe0df779dde25f86799a363556d2..8c80bc28563937c9f9f1a56bdc500191a9994b15 100644 (file)
--- 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.