Commit 2e7c8328 authored by Thomas Heller's avatar Thomas Heller

Fix SF item #876278: Unbounded recursion in modulefinder.

Already backported to release23-maint.
parent 112f8f4f
...@@ -245,6 +245,9 @@ class ModuleFinder: ...@@ -245,6 +245,9 @@ class ModuleFinder:
if self.badmodules.has_key(fqname): if self.badmodules.has_key(fqname):
self.msgout(3, "import_module -> None") self.msgout(3, "import_module -> None")
return None return None
if parent and parent.__path__ is None:
self.msgout(3, "import_module -> None")
return None
try: try:
fp, pathname, stuff = self.find_module(partname, fp, pathname, stuff = self.find_module(partname,
parent and parent.__path__, parent) parent and parent.__path__, parent)
...@@ -392,6 +395,7 @@ class ModuleFinder: ...@@ -392,6 +395,7 @@ class ModuleFinder:
def find_module(self, name, path, parent=None): def find_module(self, name, path, parent=None):
if parent is not None: if parent is not None:
# assert path is not None
fullname = parent.__name__+'.'+name fullname = parent.__name__+'.'+name
else: else:
fullname = name fullname = name
......
...@@ -306,6 +306,8 @@ Extension modules ...@@ -306,6 +306,8 @@ Extension modules
Library Library
------- -------
- Bug #876278: Unbounded recursion in modulefinder
- Bug #780300: Swap public and system ID in LexicalHandler.startDTD. - Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
Applications relying on the wrong order need to be corrected. Applications relying on the wrong order need to be corrected.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment