mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100)
Automerge-Triggered-By: GH:brettcannon
This commit is contained in:
parent
fe9f446afe
commit
ff8458b918
2 changed files with 3 additions and 1 deletions
|
|
@ -1476,7 +1476,7 @@ an :term:`importer`.
|
||||||
|
|
||||||
If **name** has no leading dots, then **name** is simply returned. This
|
If **name** has no leading dots, then **name** is simply returned. This
|
||||||
allows for usage such as
|
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.
|
check to see if the **package** argument is needed.
|
||||||
|
|
||||||
:exc:`ImportError` is raised if **name** is a relative module name but
|
:exc:`ImportError` is raised if **name** is a relative module name but
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
Updated importlib.utils.resolve_name() doc to use __spec__.parent
|
||||||
|
instead of __package__. (Thanks Yair Frid.)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue