Skip to content

Commit 19e53c4

Browse files
kj7rrvbrettcannon
andauthored
Update Doc/library/importlib.rst
Co-authored-by: Brett Cannon <brett@python.org>
1 parent 047548c commit 19e53c4

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Doc/library/importlib.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ Functions
124124
need to call :func:`invalidate_caches` in order for the new module to be
125125
noticed by the import system.
126126

127-
If the module cannot be imported, :func:`import_module` will raise an
128-
:exc:`ImportError`. If the module is found and loaded, but the code in the
129-
module raises an exception, :func:`import_module` will pass that exception
130-
to the module that called it.
127+
If the module cannot be imported, :func:`import_module` will raise
128+
:exc:`ImportError` or an appropriate subclass like
129+
:exc:`ModuleNotFoundError`.
131130

132131
.. versionchanged:: 3.3
133132
Parent packages are automatically imported.

0 commit comments

Comments
 (0)