From: Raymond Hettinger Date: Fri, 21 Feb 2003 04:18:32 +0000 (+0000) Subject: Backport 1.45: Failed module import was dumping to the console instead X-Git-Tag: v2.2.3c1~132 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b78e3dd94ec0958285768143a24d1cc0ed288068;p=thirdparty%2FPython%2Fcpython.git Backport 1.45: Failed module import was dumping to the console instead of creating a nice dialog window. --- 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: