comparison Python/errors.c @ 13883:15ad4088a700 legacy-trunk

Avoid dumping core when PyErr_NormalizeException() is called without an exception set. This shouldn't happen, but we see it at times...
author Guido van Rossum <guido@python.org>
date Mon, 07 Aug 2000 19:18:27 +0000
parents f79434ee41fa
children 25eea88047e9
comparison
equal deleted inserted replaced
13882:881d398a44e0 13883:15ad4088a700
133 PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb) 133 PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
134 { 134 {
135 PyObject *type = *exc; 135 PyObject *type = *exc;
136 PyObject *value = *val; 136 PyObject *value = *val;
137 PyObject *inclass = NULL; 137 PyObject *inclass = NULL;
138
139 if (type == NULL) {
140 /* This is a bug. Should never happen. Don't dump core. */
141 PyErr_SetString(PyExc_SystemError,
142 "PyErr_NormalizeException() called without exception");
143 }
138 144
139 /* If PyErr_SetNone() was used, the value will have been actually 145 /* If PyErr_SetNone() was used, the value will have been actually
140 set to NULL. 146 set to NULL.
141 */ 147 */
142 if (!value) { 148 if (!value) {