From: Samuel Sloniker Date: Tue, 9 Sep 2025 19:52:00 +0000 (-0700) Subject: gh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662) X-Git-Tag: v3.15.0a1~430 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66ef16105a1c47d99a5f19e8ef28776c1289e8dc;p=thirdparty%2FPython%2Fcpython.git gh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662) --- diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index ddf503af82d9..7eb048fcfc28 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -124,6 +124,10 @@ Functions need to call :func:`invalidate_caches` in order for the new module to be 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 Parent packages are automatically imported.