]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH...
authorYair Frid <fridyair@gmail.com>
Wed, 6 Jan 2021 17:42:10 +0000 (19:42 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Jan 2021 17:42:10 +0000 (09:42 -0800)
Automerge-Triggered-By: GH:brettcannon
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 f1c444fe8232c0d18fb8b9c5d528c2b1c3b08d2b..fee5df84dffcb28b32487d3ae55f4c07afebb13e 100644 (file)
@@ -1476,7 +1476,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:`ImportError` 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.)