Merge fix for #16489 from 3.3

This commit is contained in:
Brett Cannon 2012-11-17 09:33:14 -05:00
commit 10f19812b5
3 changed files with 10 additions and 6 deletions

View File

@ -94,11 +94,10 @@ Functions
:exc:`ValueError` is raised). Otherwise a search using :attr:`sys.meta_path` :exc:`ValueError` is raised). Otherwise a search using :attr:`sys.meta_path`
is done. ``None`` is returned if no loader is found. is done. ``None`` is returned if no loader is found.
A dotted name does not have its parent's implicitly imported. If that is A dotted name does not have its parent's implicitly imported as that requires
desired (although not nessarily required to find the loader, it will most loading them and that may not be desired. To properly import a submodule you
likely be needed if the loader actually is used to load the module), then will need to import all parent packages of the submodule and use the correct
you will have to import the packages containing the module prior to calling argument to *path*.
this function.
.. function:: invalidate_caches() .. function:: invalidate_caches()

View File

@ -55,7 +55,9 @@ def find_loader(name, path=None):
value of 'path' given to the finders. None is returned if no loader could value of 'path' given to the finders. None is returned if no loader could
be found. be found.
Dotted names do not have their parent packages implicitly imported. Dotted names do not have their parent packages implicitly imported. You will
most likely need to explicitly import all parent packages in the proper
order for a submodule to get the correct loader.
""" """
try: try:

View File

@ -376,6 +376,9 @@ Build
Documentation Documentation
------------- -------------
- Issue #16489: Make it clearer that importlib.find_loader() needs parent
packages to be explicitly imported.
- Issue #16400: Update the description of which versions of a given package - Issue #16400: Update the description of which versions of a given package
PyPI displays. PyPI displays.