https://github.com/python/cpython/commit/66ef16105a1c47d99a5f19e8ef28776c1289e8dc
commit: 66ef16105a1c47d99a5f19e8ef28776c1289e8dc
branch: main
author: Samuel Sloniker <[email protected]>
committer: brettcannon <[email protected]>
date: 2025-09-09T12:52:00-07:00
summary:
gh-85076: Document exceptions that can be raised by importlib.import_module
(GH-94662)
files:
M Doc/library/importlib.rst
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index ddf503af82d988..7eb048fcfc28f9 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.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]