summaryrefslogtreecommitdiffstats
path: root/Lib/modulefinder.py
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2004-05-11 15:10:59 (GMT)
committerThomas Heller <theller@ctypes.org>2004-05-11 15:10:59 (GMT)
commit2e7c8328ae637b3c8fbb693fdd5ffd2de01e1256 (patch)
treeadb2a05a5a9b83ff5ed66f35819f96e317a01e34 /Lib/modulefinder.py
parent112f8f4f81c9453e86a4ea92bfecfd5d89975598 (diff)
downloadcpython-2e7c8328ae637b3c8fbb693fdd5ffd2de01e1256.zip
cpython-2e7c8328ae637b3c8fbb693fdd5ffd2de01e1256.tar.gz
cpython-2e7c8328ae637b3c8fbb693fdd5ffd2de01e1256.tar.bz2
Fix SF item #876278: Unbounded recursion in modulefinder.
Already backported to release23-maint.
Diffstat (limited to 'Lib/modulefinder.py')
-rw-r--r--Lib/modulefinder.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index ded3125..25e1482 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -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