Fix skipped test
This commit is contained in:
parent
43b99a6f35
commit
9930bc151a
@ -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) {
|
STATIC mp_obj_t task_iternext(mp_obj_t self_in) {
|
||||||
mp_obj_task_t *self = MP_OBJ_TO_PTR(self_in);
|
mp_obj_task_t *self = MP_OBJ_TO_PTR(self_in);
|
||||||
if (TASK_IS_DONE(self)) {
|
if (TASK_IS_DONE(self)) {
|
||||||
// Task finished, raise return value to caller so it can continue.
|
if (self->data == mp_const_none) {
|
||||||
nlr_raise(self->data);
|
// 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 {
|
} else {
|
||||||
// Put calling task on waiting queue.
|
// 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));
|
mp_obj_t cur_task = mp_obj_dict_get(uasyncio_context, MP_OBJ_NEW_QSTR(MP_QSTR_cur_task));
|
||||||
|
@ -7,10 +7,6 @@
|
|||||||
# If the task _is_ subsequently awaited, then the await should succeed without
|
# If the task _is_ subsequently awaited, then the await should succeed without
|
||||||
# raising.
|
# raising.
|
||||||
|
|
||||||
# TODO: Fix this test.
|
|
||||||
print("SKIP")
|
|
||||||
raise SystemExit
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import asyncio
|
import asyncio
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -38,7 +34,6 @@ async def main():
|
|||||||
await asyncio.sleep(0)
|
await asyncio.sleep(0)
|
||||||
print("await")
|
print("await")
|
||||||
await t # should not raise.
|
await t # should not raise.
|
||||||
print("await done")
|
|
||||||
|
|
||||||
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
Loading…
Reference in New Issue
Block a user