diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-12-19 13:47:35 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-12-19 13:47:35 +0100 |
commit | 251ea9c44e5bbf0f0f5082dedd8210f42172ca9e (patch) | |
tree | 275a84d4c1e8399af55533cbe60d5d256dd76b54 /Objects/abstract.c | |
parent | b283473939e00f8ee3b773edf64b4c0098ff2e38 (diff) | |
download | cpython-251ea9c44e5bbf0f0f5082dedd8210f42172ca9e.tar.gz |
Better assertion in PyObject_Call() to detect functions returning a result with
an exception set (invalid state).
Diffstat (limited to 'Objects/abstract.c')
-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 a9c6d6b9e5..38ddb0f3df 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; } |