If no result was available, use Py_None.

This commit is contained in:
Joris Vink 2022-08-04 13:19:02 +02:00
parent fd94fba3c7
commit 7316f372d1
1 changed files with 5 additions and 0 deletions

View File

@ -4529,6 +4529,11 @@ pygather_reap_coro(struct pygather_op *op, struct python_coro *reap)
PyErr_Fetch(&type, &coro->coro->result, &traceback);
Py_DECREF(type);
Py_XDECREF(traceback);
} else {
if (coro->coro->result == NULL) {
coro->coro->result = Py_None;
Py_INCREF(Py_None);
}
}
result->obj = coro->coro->result;