diff options
author | Raymond Hettinger <python@rcn.com> | 2003-01-07 09:55:03 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-01-07 09:55:03 (GMT) |
commit | a9cfa5501ff956197e011361cbd8b04d47adcfa8 (patch) | |
tree | cba7031a076d8a2587f54709c9c367edbb6f05d4 | |
parent | ef30dc872b895245b24aae85e808638a928d14f1 (diff) | |
download | cpython-a9cfa5501ff956197e011361cbd8b04d47adcfa8.zip cpython-a9cfa5501ff956197e011361cbd8b04d47adcfa8.tar.gz cpython-a9cfa5501ff956197e011361cbd8b04d47adcfa8.tar.bz2 |
SF bug #652933 (for IdleFork): Open Module "math" Fails
When a module doesn't have a __path__ attribute, trigger a dialog box
rather than dumping a traceback to the console.
-rw-r--r-- | Tools/idle/EditorWindow.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py index c0ae556..e8c310a 100644 --- a/Tools/idle/EditorWindow.py +++ b/Tools/idle/EditorWindow.py @@ -91,7 +91,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: |