summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-04-10 20:29:48 +0000
committerGuido van Rossum <guido@python.org>2003-04-10 20:29:48 +0000
commitff1da7f2f2f107df3487564c8631685601a17004 (patch)
tree9f53ba480210aed4dd9a4fdf7878560ae6c73ce2 /Python/errors.c
parentc971dc755f4e2f4124d4df527f9577c2ab9fe0fe (diff)
downloadcpython-ff1da7f2f2f107df3487564c8631685601a17004.tar.gz
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.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/errors.c b/Python/errors.c
index d08c1afc12..d43501bbe7 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -131,9 +131,8 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
PyObject *initial_tb = NULL;
if (type == NULL) {
- /* This is a bug. Should never happen. Don't dump core. */
- PyErr_SetString(PyExc_SystemError,
- "PyErr_NormalizeException() called without exception");
+ /* There was no exception, so nothing to do. */
+ return;
}
/* If PyErr_SetNone() was used, the value will have been actually