mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Avoid dumping core when PyErr_NormalizeException() is called without
an exception set. This shouldn't happen, but we see it at times...
This commit is contained in:
parent
18c2aa25a1
commit
ed473a46fc
1 changed files with 6 additions and 0 deletions
|
@ -136,6 +136,12 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
|
|||
PyObject *value = *val;
|
||||
PyObject *inclass = NULL;
|
||||
|
||||
if (type == NULL) {
|
||||
/* This is a bug. Should never happen. Don't dump core. */
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"PyErr_NormalizeException() called without exception");
|
||||
}
|
||||
|
||||
/* If PyErr_SetNone() was used, the value will have been actually
|
||||
set to NULL.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue