]> granicus.if.org Git - python/commitdiff
Patch #685268: Consider a package's __path__ in imputil.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 13 Feb 2007 08:35:01 +0000 (08:35 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 13 Feb 2007 08:35:01 +0000 (08:35 +0000)
Lib/imputil.py
Misc/NEWS

index 8a49bb14ff6513ef035fbded954444a04da06c8f..675a634db306b061f10b32cffe5aea209b516cf8 100644 (file)
@@ -552,6 +552,10 @@ class _FilesystemImporter(Importer):
         # This method is only used when we look for a module within a package.
         assert parent
 
+        for submodule_path in parent.__path__:
+            code = self._import_pathname(_os_path_join(submodule_path, modname), fqname)
+            if code is not None:
+                return code
         return self._import_pathname(_os_path_join(parent.__pkgdir__, modname),
                                      fqname)
 
index c79f0b5fd1cc42d6bd49e6f8542ee968f37e87f1..db784943add046356be9f31121e7c625e10d205d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -169,6 +169,8 @@ Extension Modules
 Library
 -------
 
+- Patch #685268: Consider a package's __path__ in imputil.
+
 - Patch 1463026: Support default namespace in XMLGenerator.
 
 - Patch 1571379: Make trace's --ignore-dir facility work in the face of