commit c36a7759f11782f6e1d7cb9b84d5d6d5f1460c9e
parent 20c38fca579b329be00550aad3e7a38d5082f42c
Author: Joris Vink <joris@coders.se>
Date: Thu, 28 Jan 2021 10:17:02 +0100
Get Kore to build with Python 3.10.0a3.
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/python.c b/src/python.c
@@ -1037,7 +1037,13 @@ python_coro_run(struct python_coro *coro)
python_coro_trace("running", coro);
PyErr_Clear();
+#if PY_VERSION_HEX < 0x030a00a1
item = _PyGen_Send((PyGenObject *)coro->obj, NULL);
+#else
+ /* Depend on the result in item only. */
+ (void)PyIter_Send(coro->obj, NULL, &item);
+#endif
+
if (item == NULL) {
if (coro->gatherop == NULL && PyErr_Occurred() &&
PyErr_ExceptionMatches(PyExc_StopIteration)) {