Better assertion in PyObject_Call() to detect functions returning a result with

an exception set (invalid state).
This commit is contained in:
Victor Stinner 2013-12-19 13:47:35 +01:00
parent 5272fa9c57
commit 4ac9c00cff

View file

@ -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;
}