Issue 1417598: EditorWindow demo causes attr-error (original) (raw)
Running EditorWindow.py causes next error :
Traceback (most recent call last): File "C:\Python24\Lib\idlelib\EditorWindow.py", line 1410, in -toplevel- test() File "C:\Python24\Lib\idlelib\EditorWindow.py", line 1404, in test edit = EditorWindow(root=root, filename=filename) File "C:\Python24\Lib\idlelib\EditorWindow.py", line 190, in init self.update_recent_files_list() File "C:\Python24\Lib\idlelib\EditorWindow.py", line 602, in update_recent_files_list if self.top.hasattr('instance_dict'): AttributeError: ListedToplevel instance has no attribute 'hasattr' <<<<<<<
I think EditorWindow.update_recent_files_list() should check the 'instance_dict' attribute existance before accessing self.top.instance_dict.keys() in the def.
if hasattr(self.top, 'instance_dict'): xxxxx xxxxx