summaryrefslogtreecommitdiff
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-12-19 13:47:35 +0100
committerVictor Stinner <victor.stinner@gmail.com>2013-12-19 13:47:35 +0100
commit251ea9c44e5bbf0f0f5082dedd8210f42172ca9e (patch)
tree275a84d4c1e8399af55533cbe60d5d256dd76b54 /Objects/abstract.c
parentb283473939e00f8ee3b773edf64b4c0098ff2e38 (diff)
downloadcpython-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.c3
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;
}