summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-08-07 19:18:27 (GMT)
committerGuido van Rossum <guido@python.org>2000-08-07 19:18:27 (GMT)
commited473a46fc06d3e707821e5b83fa7210239a492d (patch)
tree53b917cd95d06ad42e72c163a0d0b2910e6a98b5 /Python/errors.c
parent18c2aa25a129fb6e38696b2b0fcabbb5af003a34 (diff)
downloadcpython-ed473a46fc06d3e707821e5b83fa7210239a492d.zip
cpython-ed473a46fc06d3e707821e5b83fa7210239a492d.tar.gz
cpython-ed473a46fc06d3e707821e5b83fa7210239a492d.tar.bz2
Avoid dumping core when PyErr_NormalizeException() is called without
an exception set. This shouldn't happen, but we see it at times...
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 24eeead..a9e4dae 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -136,6 +136,12 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
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.
*/