mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
Better assertion in PyObject_Call() to detect functions returning a result with
an exception set (invalid state).
This commit is contained in:
parent
5272fa9c57
commit
4ac9c00cff
1 changed files with 2 additions and 1 deletions
|
|
@ -2073,7 +2073,8 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw)
|
||||||
"NULL result without error in PyObject_Call");
|
"NULL result without error in PyObject_Call");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
assert(result != NULL || PyErr_Occurred());
|
assert((result != NULL && !PyErr_Occurred())
|
||||||
|
|| (result == NULL && PyErr_Occurred()));
|
||||||
#endif
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue