diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-10-24 23:38:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 23:38:04 (GMT) |
commit | 7717bf992c586bd4152a83c98af59a592bc8adc1 (patch) | |
tree | 5b5bad6b10e16f1ea4c2057b1e8c5855ab2634a2 /Doc/library | |
parent | 9a0476283393f9988d0946491052d7724a7f9d21 (diff) | |
download | cpython-7717bf992c586bd4152a83c98af59a592bc8adc1.zip cpython-7717bf992c586bd4152a83c98af59a592bc8adc1.tar.gz cpython-7717bf992c586bd4152a83c98af59a592bc8adc1.tar.bz2 |
importlib doc: Fix approximated import_module() code (GH-9945)
The spec gets stored on modules with the __spec__ attribute, not spec.
(cherry picked from commit 78401f7156034f713170b8e87b51d23ebdc3bdfa)
Co-authored-by: orlnub123 <orlnub123@gmail.com>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/importlib.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 356d160..760489a 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1482,7 +1482,7 @@ Python 3.6 and newer for other parts of the code). if '.' in absolute_name: parent_name, _, child_name = absolute_name.rpartition('.') parent_module = import_module(parent_name) - path = parent_module.spec.submodule_search_locations + path = parent_module.__spec__.submodule_search_locations for finder in sys.meta_path: spec = finder.find_spec(absolute_name, path) if spec is not None: |