summaryrefslogtreecommitdiff
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
authorVladimir Matveev <vladima@fb.com>2020-11-10 12:09:55 -0800
committerGitHub <noreply@github.com>2020-11-10 12:09:55 -0800
commit1e996c3a3b51e9c6f1f4cea8a6dbcf3bcb865060 (patch)
tree3f3ffd5d90532c6f4b1ec013919e3677d63dd21c /Objects/typeobject.c
parente59b2deffde61e5641cabd65034fa11b4db898ba (diff)
downloadcpython-git-1e996c3a3b51e9c6f1f4cea8a6dbcf3bcb865060.tar.gz
bpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values (#22780)
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c7
1 files changed, 7 insertions, 0 deletions
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;