mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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.
This commit is contained in:
parent
ef30dc872b
commit
a9cfa5501f
1 changed files with 4 additions and 1 deletions
|
@ -91,7 +91,10 @@ def _find_module(fullname, path=None):
|
||||||
if descr[2] == imp.PY_SOURCE:
|
if descr[2] == imp.PY_SOURCE:
|
||||||
break # find but not load the source file
|
break # find but not load the source file
|
||||||
module = imp.load_module(tgt, file, filename, descr)
|
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
|
return file, filename, descr
|
||||||
|
|
||||||
class EditorWindow:
|
class EditorWindow:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue