]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 7 Jan 2021 18:07:48 +0000 (10:07 -0800)
committerGitHub <noreply@github.com>
Thu, 7 Jan 2021 18:07:48 +0000 (10:07 -0800)
Automerge-Triggered-By: GH:brettcannon
(cherry picked from commit ff8458b918050168acda1ad6d079f52b8effa821)

Co-authored-by: Yair Frid <fridyair@gmail.com>
Doc/library/importlib.rst
Misc/NEWS.d/next/Documentation/2021-01-04-22-14-22.bpo-42811.HY2beA.rst [new file with mode: 0644]

index 8635e2bc66f3a8f506a2acb7d5eaf2e5620ce2d1..304da984ace6b64b3482b8501d84f6f49493bb2b 100644 (file)
@@ -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 (file)
index 0000000..768508e
--- /dev/null
@@ -0,0 +1,2 @@
+Updated importlib.utils.resolve_name() doc to use __spec__.parent
+instead of __package__. (Thanks Yair Frid.)