]> 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:34:45 +0000 (08:34 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 13 Feb 2007 08:34:45 +0000 (08:34 +0000)
Will backport.

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 36ac1df5a17cadd1ef44f6e22a2c49c9d431cc1a..7b300443456ab5e65de26423dd0570148e065244 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -128,6 +128,8 @@ Core and builtins
 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