diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-12-19 12:47:35 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-12-19 12:47:35 (GMT) |
commit | 4ac9c00cff2218e56d0d7f6385c4a0fbf9bcd20f (patch) | |
tree | 4c80728c819c6bbdfb8700454fd2fad0aa4fa5d5 /Objects | |
parent | 5272fa9c5707b3cdcd6f49fdaf595b21bec6b2bd (diff) | |
download | cpython-4ac9c00cff2218e56d0d7f6385c4a0fbf9bcd20f.zip cpython-4ac9c00cff2218e56d0d7f6385c4a0fbf9bcd20f.tar.gz cpython-4ac9c00cff2218e56d0d7f6385c4a0fbf9bcd20f.tar.bz2 |
Better assertion in PyObject_Call() to detect functions returning a result with
an exception set (invalid state).
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index a9c6d6b..38ddb0f 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2073,7 +2073,8 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) "NULL result without error in PyObject_Call"); } #else - assert(result != NULL || PyErr_Occurred()); + assert((result != NULL && !PyErr_Occurred()) + || (result == NULL && PyErr_Occurred())); #endif return result; } |