Skip to content

Commit 66ef161

Browse files
authored
gh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662)
1 parent af58a6f commit 66ef161

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/importlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ 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
128+
:exc:`ImportError` or an appropriate subclass like
129+
:exc:`ModuleNotFoundError`.
130+
127131
.. versionchanged:: 3.3
128132
Parent packages are automatically imported.
129133

0 commit comments

Comments
 (0)