Skip to content

Commit 047548c

Browse files
committed
Document ImportError from importlib
Closes #85076
1 parent 14fea6b commit 047548c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Doc/library/importlib.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ 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.
131+
127132
.. versionchanged:: 3.3
128133
Parent packages are automatically imported.
129134

0 commit comments

Comments
 (0)