summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index f14a923..842c367 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2804,9 +2804,7 @@ PyIter_Send(PyObject *iter, PyObject *arg, PyObject **result)
_Py_IDENTIFIER(send);
assert(arg != NULL);
assert(result != NULL);
- if (PyType_HasFeature(Py_TYPE(iter), Py_TPFLAGS_HAVE_AM_SEND)) {
- assert (Py_TYPE(iter)->tp_as_async != NULL);
- assert (Py_TYPE(iter)->tp_as_async->am_send != NULL);
+ if (Py_TYPE(iter)->tp_as_async && Py_TYPE(iter)->tp_as_async->am_send) {
PySendResult res = Py_TYPE(iter)->tp_as_async->am_send(iter, arg, result);
assert(_Py_CheckSlotResult(iter, "am_send", res != PYGEN_ERROR));
return res;