summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2003-01-10 21:25:20 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2003-01-10 21:25:20 (GMT)
commit69e8afcc9fcd8a41a1035893d60893d51fae62f1 (patch)
treec91663056acb7c7c7dee89d7815831177b06446c /Lib/idlelib/EditorWindow.py
parentdf8b47fc80a0a1fac2902fa675ae7a547bb973a2 (diff)
downloadcpython-69e8afcc9fcd8a41a1035893d60893d51fae62f1.zip
cpython-69e8afcc9fcd8a41a1035893d60893d51fae62f1.tar.gz
cpython-69e8afcc9fcd8a41a1035893d60893d51fae62f1.tar.bz2
SF bug #652933 (for IdleFork): Open Module "math" Fails (Hettinger)
When a module doesn't have a __path__ attribute, trigger a dialog box rather than dumping a traceback to the console. Synch to Python IDLE.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index af60eca..b940c3b 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -30,7 +30,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: