Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47c2b60

Browse files
committed
#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.
1 parent 5cff931 commit 47c2b60

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/idlelib/WindowList.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def add_windows_to_menu(self, menu):
2626
title = window.get_title()
2727
except TclError:
2828
continue
29-
list.append((title, window))
29+
list.append((title, key, window))
3030
list.sort()
31-
for title, window in list:
31+
for title, key, window in list:
3232
menu.add_command(label=title, command=window.wakeup)
3333

3434
def register_callback(self, callback):

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Core and Builtins
2424
Library
2525
-------
2626

27+
- Issue #4455: IDLE failed to display the windows list when two windows have
28+
the same title.
29+
2730
- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
2831
exception.
2932

0 commit comments

Comments
 (0)