diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2014-03-04 10:39:42 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2014-03-04 10:39:42 (GMT) |
commit | dc855b7b1f6c7e9a9eb73bcf2b50619f2dfaf703 (patch) | |
tree | dc09b03fac8694c964cf9e0df6e89cf55bb8d7ca /Doc/library/pkgutil.rst | |
parent | c913a7a6f68044584f7bee90ba85d5c27e7859fe (diff) | |
download | cpython-dc855b7b1f6c7e9a9eb73bcf2b50619f2dfaf703.zip cpython-dc855b7b1f6c7e9a9eb73bcf2b50619f2dfaf703.tar.gz cpython-dc855b7b1f6c7e9a9eb73bcf2b50619f2dfaf703.tar.bz2 |
Close #20839: pkgutil.find_loader now uses importlib.util.find_spec
Diffstat (limited to 'Doc/library/pkgutil.rst')
-rw-r--r-- | Doc/library/pkgutil.rst | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Doc/library/pkgutil.rst b/Doc/library/pkgutil.rst index 22d44eb..10b7848 100644 --- a/Doc/library/pkgutil.rst +++ b/Doc/library/pkgutil.rst @@ -74,15 +74,17 @@ support. Retrieve a :pep:`302` module loader for the given *fullname*. - This is a convenience wrapper around :func:`importlib.find_loader` that - sets the *path* argument correctly when searching for submodules, and - also ensures parent packages (if any) are imported before searching for - submodules. + This is a backwards compatibility wrapper around + :func:`importlib.util.find_spec` that converts most failures to + :exc:`ImportError` and only returns the loader rather than the full + :class:`ModuleSpec`. .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying on the package internal PEP 302 import emulation. + .. versionchanged:: 3.4 + Updated to be based on :pep:`451` .. function:: get_importer(path_item) @@ -109,14 +111,13 @@ support. not already imported, its containing package (if any) is imported, in order to establish the package ``__path__``. - This function uses :func:`iter_importers`, and is thus subject to the same - limitations regarding platform-specific special import locations such as the - Windows registry. - .. versionchanged:: 3.3 Updated to be based directly on :mod:`importlib` rather than relying on the package internal PEP 302 import emulation. + .. versionchanged:: 3.4 + Updated to be based on :pep:`451` + .. function:: iter_importers(fullname='') |