diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-29 01:26:02 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-29 01:26:02 +0000 |
commit | c47fd2da8ec705a3c6f51d1a09b7bf4a180a01ff (patch) | |
tree | 8304956bd360b2bda7a6f5ee8e9443111da183dd /py/objexcept.c | |
parent | bcc9298e5bd2049bbee8c1d00482d2695b8e0b70 (diff) | |
parent | 1d7553311c70810a6fea2d72b04403b93711389c (diff) |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'py/objexcept.c')
-rw-r--r-- | py/objexcept.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/objexcept.c b/py/objexcept.c index 71874751b..d4c4b1249 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -21,6 +21,12 @@ typedef struct mp_obj_exception_t { mp_obj_tuple_t args; } mp_obj_exception_t; +// Instance of GeneratorExit exception - needed by generator.close() +// This would belong to objgenerator.c, but to keep mp_obj_exception_t +// definition module-private so far, have it here. +STATIC mp_obj_exception_t GeneratorExit_obj = {{&mp_type_GeneratorExit}, MP_OBJ_NULL, NULL, {{&tuple_type}, 0}}; +const mp_obj_t mp_const_GeneratorExit = (mp_obj_t)&GeneratorExit_obj; + STATIC void mp_obj_exception_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) { mp_obj_exception_t *o = o_in; if (o->msg != NULL) { |