]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix SF item #876278: Unbounded recursion in modulefinder.
authorThomas Heller <theller@ctypes.org>
Tue, 11 May 2004 15:00:07 +0000 (15:00 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 11 May 2004 15:00:07 +0000 (15:00 +0000)
Lib/modulefinder.py
Misc/NEWS

index 6dec0e5903d971c3b032fb03fd3aba4fcc283620..97a6c2501077848ec8cbbc2a4f648fbbd7b06879 100644 (file)
@@ -245,6 +245,9 @@ class ModuleFinder:
         if self.badmodules.has_key(fqname):
             self.msgout(3, "import_module -> None")
             return None
+        if parent and parent.__path__ is None:
+            self.msgout(3, "import_module -> None")
+            return None
         try:
             fp, pathname, stuff = self.find_module(partname,
                                                    parent and parent.__path__, parent)
@@ -392,6 +395,7 @@ class ModuleFinder:
 
     def find_module(self, name, path, parent=None):
         if parent is not None:
+            # assert path is not None
             fullname = parent.__name__+'.'+name
         else:
             fullname = name
index 63cec4c205681ca48a35ee2cf0dc3f89dda36a5b..d682acc5d45349fabfa6d904d525560d88729c48 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,8 @@ Core and builtins
 Library
 -------
 
+- Bug #876278: Unbounded recursion in modulefinder
+
 - Brought platform.py in line with the 2.4 version, fixing support for
   newer Windows versions and a cache issue.