projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ef30dc8
)
SF bug #652933 (for IdleFork): Open Module "math" Fails
author
Raymond Hettinger
<python@rcn.com>
Tue, 7 Jan 2003 09:55:03 +0000
(09:55 +0000)
committer
Raymond Hettinger
<python@rcn.com>
Tue, 7 Jan 2003 09:55:03 +0000
(09:55 +0000)
When a module doesn't have a __path__ attribute, trigger a dialog box
rather than dumping a traceback to the console.
Tools/idle/EditorWindow.py
patch
|
blob
|
history
diff --git
a/Tools/idle/EditorWindow.py
b/Tools/idle/EditorWindow.py
index c0ae556d3a6627d11337e49c5396c65dfbb24a65..e8c310a1cc1fa7585bb4d66454c4ed85ccce6be3 100644
(file)
--- 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: