mirror of https://github.com/python/cpython
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:
parent
25334ca082
commit
247e059de3
|
@ -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
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue