comparison Python/errors.c @ 28572:faeb708bacc4 2.2

Backport: 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.
author Guido van Rossum <guido@python.org>
date Thu, 10 Apr 2003 20:30:18 +0000
parents d4406fbfcb4e
children
comparison
equal deleted inserted replaced
28555:b4487a3b5f1a 28572:faeb708bacc4
129 PyObject *value = *val; 129 PyObject *value = *val;
130 PyObject *inclass = NULL; 130 PyObject *inclass = NULL;
131 PyObject *initial_tb = NULL; 131 PyObject *initial_tb = NULL;
132 132
133 if (type == NULL) { 133 if (type == NULL) {
134 /* This is a bug. Should never happen. Don't dump core. */ 134 /* There was no exception, so nothing to do. */
135 PyErr_SetString(PyExc_SystemError, 135 return;
136 "PyErr_NormalizeException() called without exception");
137 } 136 }
138 137
139 /* If PyErr_SetNone() was used, the value will have been actually 138 /* If PyErr_SetNone() was used, the value will have been actually
140 set to NULL. 139 set to NULL.
141 */ 140 */