]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport 1.45: Failed module import was dumping to the console instead
authorRaymond Hettinger <python@rcn.com>
Fri, 21 Feb 2003 04:18:32 +0000 (04:18 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 21 Feb 2003 04:18:32 +0000 (04:18 +0000)
of creating a nice dialog window.

Tools/idle/EditorWindow.py

index e469a0fb3c3ec757cb4c2cd838b61b73ff3a3840..55b0e6a382efb006176d72c1d1a4cbbd802a6e43 100644 (file)
@@ -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: