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

Fixes #92994
This commit is contained in:
Shantanu 2022-05-22 18:53:24 -07:00 committed by GitHub
parent b7a6610bc8
commit e39cd76561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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