10000 bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__… · python/cpython@ff8458b · GitHub
[go: up one dir, main page]

Skip to content

Commit ff8458b

Browse files
authored
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100)
Automerge-Triggered-By: GH:brettcannon
1 parent fe9f446 commit ff8458b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Doc/library/importlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ an :term:`importer`.
14761476

14771477
If **name** has no leading dots, then **name** is simply returned. This
14781478
allows for usage such as
1479-
``importlib.util.resolve_name('sys', __package__)`` without doing a
1479+
``importlib.util.resolve_name('sys', __spec__.parent)`` without doing a
14801480
check to see if the **package** argument is needed.
14811481

14821482
:exc:`ImportError` is raised if **name** is a relative module name but
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Updated importlib.utils.resolve_name() doc to use __spec__.parent
2+
instead of __package__. (Thanks Yair Frid.)

0 commit comments

Comments
 (0)
0