gh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662)

This commit is contained in:
Samuel Sloniker 2025-09-09 12:52:00 -07:00 committed by GitHub
parent af58a6f883
commit 66ef16105a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,6 +124,10 @@ Functions
need to call :func:`invalidate_caches` in order for the new module to be need to call :func:`invalidate_caches` in order for the new module to be
noticed by the import system. noticed by the import system.
If the module cannot be imported, :func:`import_module` will raise
:exc:`ImportError` or an appropriate subclass like
:exc:`ModuleNotFoundError`.
.. versionchanged:: 3.3 .. versionchanged:: 3.3
Parent packages are automatically imported. Parent packages are automatically imported.