bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent (GH-24100)

Automerge-Triggered-By: GH:brettcannon
This commit is contained in:
Yair Frid 2021-01-06 19:42:10 +02:00 committed by GitHub
parent fe9f446afe
commit ff8458b918
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View 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

View file

@ -0,0 +1,2 @@
Updated importlib.utils.resolve_name() doc to use __spec__.parent
instead of __package__. (Thanks Yair Frid.)