Fix skipped test

This commit is contained in:
Scott Shawcroft 2023-10-11 14:43:14 -07:00
parent 43b99a6f35
commit 9930bc151a
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
2 changed files with 7 additions and 7 deletions

View File

@ -294,8 +294,13 @@ STATIC mp_obj_t task_getiter(mp_obj_t self_in, mp_obj_iter_buf_t *iter_buf) {
STATIC mp_obj_t task_iternext(mp_obj_t self_in) {
mp_obj_task_t *self = MP_OBJ_TO_PTR(self_in);
if (TASK_IS_DONE(self)) {
if (self->data == mp_const_none) {
// Task finished but has already been sent to the loop's exception handler.
mp_raise_StopIteration(MP_OBJ_NULL);
} else {
// Task finished, raise return value to caller so it can continue.
nlr_raise(self->data);
}
} else {
// Put calling task on waiting queue.
mp_obj_t cur_task = mp_obj_dict_get(uasyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_cur_task));

View File

@ -7,10 +7,6 @@
# If the task _is_ subsequently awaited, then the await should succeed without
# raising.
# TODO: Fix this test.
print("SKIP")
raise SystemExit
try:
import asyncio
except ImportError:
@ -38,7 +34,6 @@ async def main():
await asyncio.sleep(0)
print("await")
await t # should not raise.
print("await done")
asyncio.run(main())