From 1e996c3a3b51e9c6f1f4cea8a6dbcf3bcb865060 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 10 Nov 2020 12:09:55 -0800 Subject: bpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values (#22780) --- Objects/typeobject.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Objects/typeobject.c') diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 55bf9b3f38..b4188b8bca 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5427,6 +5427,13 @@ PyType_Ready(PyTypeObject *type) _PyObject_ASSERT((PyObject *)type, type->tp_vectorcall_offset > 0); _PyObject_ASSERT((PyObject *)type, type->tp_call != NULL); } + /* Consistency check for Py_TPFLAGS_HAVE_AM_SEND - flag requires + * type->tp_as_async->am_send to be present. + */ + if (type->tp_flags & Py_TPFLAGS_HAVE_AM_SEND) { + _PyObject_ASSERT((PyObject *)type, type->tp_as_async != NULL); + _PyObject_ASSERT((PyObject *)type, type->tp_as_async->am_send != NULL); + } type->tp_flags |= Py_TPFLAGS_READYING; -- cgit v1.2.1