[Python-checkins] cpython (merge default -> default): merge from push conflict.

senthil.kumaran python-checkins at python.org
Wed Apr 13 03:43:48 CEST 2011


http://hg.python.org/cpython/rev/a4d1a3e0f7bd
changeset:   69306:a4d1a3e0f7bd
parent:      69305:35b16d49c0b1
parent:      69299:c8d075051e88
user:        Senthil Kumaran <orsenthil at gmail.com>
date:        Wed Apr 13 09:38:51 2011 +0800
summary:
  merge from push conflict.

files:
  Lib/idlelib/EditorWindow.py |  11 +++++++++++
  1 files changed, 11 insertions(+), 0 deletions(-)


diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -50,6 +50,17 @@
             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):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list