Skip to content

Commit

Permalink
gh-92994: Clarify importlib "check" example (GH-92995)
Browse files Browse the repository at this point in the history
Fixes GH-92994
(cherry picked from commit e39cd76)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
  • Loading branch information
miss-islington and hauntsaninja committed May 23, 2022
1 parent 619a67c commit 936eefc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Doc/library/importlib.rst
Expand Up @@ -1749,6 +1749,9 @@ Checking if a module can be imported

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`.

Note that if ``name`` is a submodule (contains a dot),
:func:`importlib.util.find_spec` will import the parent module.
::

import importlib.util
Expand Down

0 comments on commit 936eefc

Please sign in to comment.