diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-05-10 00:41:34 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-05-10 00:41:49 +0300 |
commit | 4ed7b7f751b161420e6979927fd0756467a10cb7 (patch) | |
tree | 1c1d484269c9a5afe6886d1cf13ec1ea3c5b3f4c /py/runtime.c | |
parent | a37d13c95d1e91bc278ff01e8315d8389a218828 (diff) | |
download | micropython-4ed7b7f751b161420e6979927fd0756467a10cb7.tar.gz micropython-4ed7b7f751b161420e6979927fd0756467a10cb7.zip |
py: iternext() may not return MP_OBJ_NULL, only MP_OBJ_STOP_ITERATION.
Testing for incorrect value led to premature termination of generator
containing yield from for such iterator (e.g. "yield from [1, 2]").
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/runtime.c b/py/runtime.c index 2b5b5bc371..68728642bf 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1081,7 +1081,7 @@ mp_vm_return_kind_t mp_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t th if (type->iternext != NULL && send_value == mp_const_none) { mp_obj_t ret = type->iternext(self_in); - if (ret != MP_OBJ_NULL) { + if (ret != MP_OBJ_STOP_ITERATION) { *ret_val = ret; return MP_VM_RETURN_YIELD; } else { |