From b78e3dd94ec0958285768143a24d1cc0ed288068 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 21 Feb 2003 04:18:32 +0000 Subject: [PATCH] Backport 1.45: Failed module import was dumping to the console instead of creating a nice dialog window. --- Tools/idle/EditorWindow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py index e469a0fb3c3e..55b0e6a382ef 100644 --- a/Tools/idle/EditorWindow.py +++ b/Tools/idle/EditorWindow.py @@ -92,7 +92,10 @@ def _find_module(fullname, path=None): if descr[2] == imp.PY_SOURCE: break # find but not load the source file module = imp.load_module(tgt, file, filename, descr) - path = module.__path__ + try: + path = module.__path__ + except AttributeError: + raise ImportError, 'No source for module ' + module.__name__ return file, filename, descr class EditorWindow: -- 2.47.3