diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2011-04-13 01:39:35 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2011-04-13 01:39:35 (GMT) |
commit | c90d02c917837825f7c03b1dfe1222de035fc640 (patch) | |
tree | ffecbdacc529b791266370981dc9108c8a3c2442 /Lib/idlelib | |
parent | 665b39803dac1d3835fbc22dc81fafc5f2748fac (diff) | |
parent | f6445e8f4179cbf8825a9d873800c44f9687e229 (diff) | |
download | cpython-c90d02c917837825f7c03b1dfe1222de035fc640.zip cpython-c90d02c917837825f7c03b1dfe1222de035fc640.tar.gz cpython-c90d02c917837825f7c03b1dfe1222de035fc640.tar.bz2 |
merge from push conflict.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index ffc4e88..3b7bb6d 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -50,6 +50,17 @@ def _find_module(fullname, path=None): path = module.__path__ except AttributeError: raise ImportError('No source for module ' + module.__name__) + if descr[2] != imp.PY_SOURCE: + # If all of the above fails and didn't raise an exception,fallback + # to a straight import which can find __init__.py in a package. + m = __import__(fullname) + try: + filename = m.__file__ + except AttributeError: + pass + else: + file = None + descr = os.path.splitext(filename), None, imp.PY_SOURCE return file, filename, descr class EditorWindow(object): |