summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/WindowList.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/WindowList.py')
-rw-r--r--Lib/idlelib/WindowList.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/idlelib/WindowList.py b/Lib/idlelib/WindowList.py
index 658502b..bc74348 100644
--- a/Lib/idlelib/WindowList.py
+++ b/Lib/idlelib/WindowList.py
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
class WindowList:
@@ -20,15 +20,15 @@ class WindowList:
def add_windows_to_menu(self, menu):
list = []
- for key in self.dict.keys():
+ for key in self.dict:
window = self.dict[key]
try:
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):
@@ -45,8 +45,8 @@ class WindowList:
try:
callback()
except:
- print "warning: callback failed in WindowList", \
- sys.exc_type, ":", sys.exc_value
+ t, v, tb = sys.exc_info()
+ print("warning: callback failed in WindowList", t, ":", v)
registry = WindowList()