]> granicus.if.org Git - python/commitdiff
Patch #698082 from Thomas Heller: Modulefinder didn't exclude modules
authorJust van Rossum <just@letterror.com>
Wed, 5 Mar 2003 17:23:48 +0000 (17:23 +0000)
committerJust van Rossum <just@letterror.com>
Wed, 5 Mar 2003 17:23:48 +0000 (17:23 +0000)
in packages correctly.

Lib/modulefinder.py

index f551a7653187303d9ddddd1a1d794f0df1c21e20..92ecbcb80ca4bd66579db263a184a827da43401f 100644 (file)
@@ -242,7 +242,7 @@ class ModuleFinder:
             return None
         try:
             fp, pathname, stuff = self.find_module(partname,
-                                                   parent and parent.__path__)
+                                                   parent and parent.__path__, parent)
         except ImportError:
             self.msgout(3, "import_module ->", None)
             return None
@@ -385,9 +385,9 @@ class ModuleFinder:
         self.modules[fqname] = m = Module(fqname)
         return m
 
-    def find_module(self, name, path):
-        if path:
-            fullname = '.'.join(path)+'.'+name
+    def find_module(self, name, path, parent=None):
+        if parent is not None:
+            fullname = parent.__name__+'.'+name
         else:
             fullname = name
         if fullname in self.excludes: