Skip to content

Commit 38b8246

Browse files
authored
set ag_running_async = 1 when calling async_gen_athrow_throw or async_gen_send_throw
1 parent cbd302d commit 38b8246

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Objects/genobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,7 @@ async_gen_asend_throw(PyAsyncGenASend *o, PyObject *const *args, Py_ssize_t narg
18251825
}
18261826

18271827
o->ags_state = AWAITABLE_STATE_ITER;
1828+
o->ags_gen->ag_running_async = 1;
18281829
}
18291830

18301831
result = gen_throw((PyGenObject*)o->ags_gen, args, nargs);
@@ -2237,6 +2238,7 @@ async_gen_athrow_throw(PyAsyncGenAThrow *o, PyObject *const *args, Py_ssize_t na
22372238
}
22382239

22392240
o->agt_state = AWAITABLE_STATE_ITER;
2241+
o->agt_gen->ag_running_async = 1;
22402242
}
22412243

22422244
retval = gen_throw((PyGenObject*)o->agt_gen, args, nargs);

0 commit comments

Comments
 (0)