mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
PyErr_NormalizeException(): in the type==NULL test, we should simply
return. Setting an exception can mess with the exception state, and continuing is definitely wrong (since type is dereferenced later on). Some code that calls this seems to be prepared for a NULL exception type, so let's be safe rather than sorry and simply assume there's nothing to normalize in this case.
This commit is contained in:
parent
594adac0bf
commit
6b3fffaf99
1 changed files with 2 additions and 3 deletions
|
@ -131,9 +131,8 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
|
|||
PyObject *initial_tb = NULL;
|
||||
|
||||
if (type == NULL) {
|
||||
/* This is a bug. Should never happen. Don't dump core. */
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"PyErr_NormalizeException() called without exception");
|
||||
/* There was no exception, so nothing to do. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* If PyErr_SetNone() was used, the value will have been actually
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue