gh-92994: Clarify importlib "check" example (GH-92995)

Fixes GH-92994
(cherry picked from commit e39cd76561)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-05-22 19:10:57 -07:00 committed by GitHub
parent 25334ca082
commit 247e059de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1250,6 +1250,9 @@ Checking if a module can be imported
If you need to find out if a module can be imported without actually doing the If you need to find out if a module can be imported without actually doing the
import, then you should use :func:`importlib.util.find_spec`. import, then you should use :func:`importlib.util.find_spec`.
Note that if ``name`` is a submodule (contains a dot),
:func:`importlib.util.find_spec` will import the parent module.
:: ::
import importlib.util import importlib.util