diff options
author | 2021-01-07 10:07:48 -0800 | |
---|---|---|
committer | 2021-01-07 10:07:48 -0800 | |
commit | ca8e96d1edbeb536f58da91e607082463398fce1 (patch) | |
tree | 858fc74f783c431f9f1350853f7837f8b57807d2 | |
parent | bpo-42584: Update Windows installer to use SQLite 3.34.0 (GH-23675) (diff) | |
download | cpython-ca8e96d1edbeb536f58da91e607082463398fce1.tar.gz cpython-ca8e96d1edbeb536f58da91e607082463398fce1.tar.bz2 cpython-ca8e96d1edbeb536f58da91e607082463398fce1.zip |
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100) (GH-24144)
Automerge-Triggered-By: GH:brettcannon
(cherry picked from commit ff8458b918050168acda1ad6d079f52b8effa821)
Co-authored-by: Yair Frid <fridyair@gmail.com>
-rw-r--r-- | Doc/library/importlib.rst | 2 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 8635e2bc66f..304da984ace 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1439,7 +1439,7 @@ an :term:`importer`. If **name** has no leading dots, then **name** is simply returned. This allows for usage such as - ``importlib.util.resolve_name('sys', __package__)`` without doing a + ``importlib.util.resolve_name('sys', __spec__.parent)`` without doing a check to see if the **package** argument is needed. :exc:`ValueError` is raised if **name** is a relative module name but diff --git a/Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst b/Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst new file mode 100644 index 00000000000..768508e0ce1 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst @@ -0,0 +1,2 @@ +Updated importlib.utils.resolve_name() doc to use __spec__.parent +instead of __package__. (Thanks Yair Frid.) |