summaryrefslogtreecommitdiff
path: root/Doc/library/importlib.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/importlib.rst')
-rw-r--r--Doc/library/importlib.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index 3c9a99abf9..23831c7584 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -1737,7 +1737,8 @@ Python 3.6 and newer for other parts of the code).
if spec is not None:
break
else:
- raise ImportError(f'No module named {absolute_name!r}')
+ msg = f'No module named {absolute_name!r}'
+ raise ModuleNotFoundError(msg, name=absolute_name)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
sys.modules[absolute_name] = module