Mercurial > cpython-lru_cache-weakref
diff 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 |
line wrap: on
line diff
--- a/Python/errors.c Mon Aug 07 17:33:38 2000 +0000 +++ b/Python/errors.c Mon Aug 07 19:18:27 2000 +0000 @@ -136,6 +136,12 @@ 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. */
