summaryrefslogtreecommitdiff
path: root/Include/pyerrors.h
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-12 23:29:18 -0400
committerBrett Cannon <brett@python.org>2013-06-12 23:29:18 -0400
commit8f5ac5106eb24dd8bda91f25e993a90a820a2d5c (patch)
tree49b910fbfa1af58f0c017d42c84d507b338d7bb2 /Include/pyerrors.h
parent3e9a9ae09d6fc9169b01cba3efd1ae03ab40b237 (diff)
downloadcpython-git-8f5ac5106eb24dd8bda91f25e993a90a820a2d5c.tar.gz
Issue #15767: Touch up ModuleNotFoundError usage by import.
Forgot to raise ModuleNotFoundError when None is found in sys.modules. This led to introducing the C function PyErr_SetImportErrorSubclass() to make setting ModuleNotFoundError easier. Also updated the reference docs to mention ModuleNotFoundError appropriately. Updated the docs for ModuleNotFoundError to mention the None in sys.modules case. Lastly, it was noticed that PyErr_SetImportError() was not setting an exception when returning None in one case. That issue is now fixed.
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 2e66c0efb6..22a22cef2c 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -268,6 +268,9 @@ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
PyAPI_FUNC(PyObject *) PyErr_SetExcWithArgsKwargs(PyObject *, PyObject *,
PyObject *);
+
+PyAPI_FUNC(PyObject *) PyErr_SetImportErrorSubclass(PyObject *, PyObject *,
+ PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetImportError(PyObject *, PyObject *,
PyObject *);