]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-85076: Document exceptions that can be raised by importlib.import_module (GH-94662)
authorSamuel Sloniker <sam@kj7rrv.com>
Tue, 9 Sep 2025 19:52:00 +0000 (12:52 -0700)
committerGitHub <noreply@github.com>
Tue, 9 Sep 2025 19:52:00 +0000 (12:52 -0700)
Doc/library/importlib.rst

index ddf503af82d988afb6c5510707991ae13fa9bcec..7eb048fcfc28f964fc7f0a78d1e7ec6290ad8ab4 100644 (file)
@@ -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.