summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-07-15 19:10:35 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-07-15 19:10:35 (GMT)
commite92cd0ce987d11acf2b93d43171f61c297e935ba (patch)
tree14c0986adc09d30245c97157fb1eac79b0f68102 /Python/ceval.c
parentaf5bacf9bb9b9729fac3da50111441b1f0efdd44 (diff)
parent5afa03a72ee6d27e742dc0ebc06a0630e1b37fe9 (diff)
downloadcpython-e92cd0ce987d11acf2b93d43171f61c297e935ba.zip
cpython-e92cd0ce987d11acf2b93d43171f61c297e935ba.tar.gz
cpython-e92cd0ce987d11acf2b93d43171f61c297e935ba.tar.bz2
merge 3.2 (#11627)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 5c93637..6d49363 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3494,6 +3494,13 @@ do_raise(PyObject *exc, PyObject *cause)
value = PyObject_CallObject(exc, NULL);
if (value == NULL)
goto raise_error;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto raise_error;
+ }
}
else if (PyExceptionInstance_Check(exc)) {
value = exc;