diff options
author | Guido van Rossum <guido@python.org> | 2000-08-07 19:18:27 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-08-07 19:18:27 +0000 |
commit | 89b0470f855b8132caa9f9a86849899c974c9115 (patch) | |
tree | cc7fc96bd5adac5ed131da5f50a392e3db8d8c61 /Python/errors.c | |
parent | d9f812095a60dad9fd1026180666cd6e26447ff1 (diff) | |
download | cpython-89b0470f855b8132caa9f9a86849899c974c9115.tar.gz |
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/errors.c b/Python/errors.c index 24eeead9ce..a9e4daed9b 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. */ |