Kaydet (Commit) 6b3fffaf authored tarafından Guido van Rossum's avatar Guido van Rossum

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.
üst 594adac0
...@@ -131,9 +131,8 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb) ...@@ -131,9 +131,8 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
PyObject *initial_tb = NULL; PyObject *initial_tb = NULL;
if (type == NULL) { if (type == NULL) {
/* This is a bug. Should never happen. Don't dump core. */ /* There was no exception, so nothing to do. */
PyErr_SetString(PyExc_SystemError, return;
"PyErr_NormalizeException() called without exception");
} }
/* If PyErr_SetNone() was used, the value will have been actually /* If PyErr_SetNone() was used, the value will have been actually
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment