Skip to content

Commit c90d02c

Browse files
committed
merge from push conflict.
2 parents 665b398 + f6445e8 commit c90d02c

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Lib/idlelib/EditorWindow.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ def _find_module(fullname, path=None):
5050
path = module.__path__
5151
except AttributeError:
5252
raise ImportError('No source for module ' + module.__name__)
53+
if descr[2] != imp.PY_SOURCE:
54+
# If all of the above fails and didn't raise an exception,fallback
55+
# to a straight import which can find __init__.py in a package.
56+
m = __import__(fullname)
57+
try:
58+
filename = m.__file__
59+
except AttributeError:
60+
pass
61+
else:
62+
file = None
63+
descr = os.path.splitext(filename), None, imp.PY_SOURCE
5364
return file, filename, descr
5465

5566
class EditorWindow(object):

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ Build
227227
- Issue #11268: Prevent Mac OS X Installer failure if Documentation
228228
package had previously been installed.
229229

230+
IDLE
231+
----
232+
233+
- Issue #11718: IDLE's open module dialog couldn't find the __init__.py
234+
file in a package.
235+
230236
Tools/Demos
231237
-----------
232238

0 commit comments

Comments
 (0)