[Python-checkins] python/dist/src/Tools/idle EditorWindow.py,1.44,1.45
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
2003年1月07日 01:55:08 -0800
Update of /cvsroot/python/python/dist/src/Tools/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv23740
Modified Files:
EditorWindow.py
Log Message:
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.
Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/EditorWindow.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** EditorWindow.py 11 Sep 2002 20:36:01 -0000 1.44
--- EditorWindow.py 7 Jan 2003 09:55:03 -0000 1.45
***************
*** 92,96 ****
break # find but not load the source file
module = imp.load_module(tgt, file, filename, descr)
! path = module.__path__
return file, filename, descr
--- 92,99 ----
break # find but not load the source file
module = imp.load_module(tgt, file, filename, descr)
! try:
! path = module.__path__
! except AttributeError:
! raise ImportError, 'No source for module ' + module.__name__
return file, filename, descr