]> granicus.if.org Git - python/commitdiff
Fix SF item #876278: Unbounded recursion in modulefinder.
authorThomas Heller <theller@ctypes.org>
Tue, 11 May 2004 15:10:59 +0000 (15:10 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 11 May 2004 15:10:59 +0000 (15:10 +0000)
Already backported to release23-maint.

Lib/modulefinder.py
Misc/NEWS

index ded3125336317e621caceeb4c9bf85fd7e2bec3f..25e14827c3c0640289299ac7a8a001c696f575c5 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 809d2d972cb44d6f78a98b187bbccacb359234bd..f111d0ef4af606c96be5a734a37be926513b3bb0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -306,6 +306,8 @@ Extension modules
 Library
 -------
 
+- Bug #876278: Unbounded recursion in modulefinder
+
 - Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
   Applications relying on the wrong order need to be corrected.