diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-09-01 10:35:58 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-09-01 10:39:04 +0300 |
commit | 2ff2ea5f3b1904834b287e74415f329b31d9a3db (patch) | |
tree | 2e6a0d290bd9a3e62029b2e8982c531a866faac5 /py/vm.c | |
parent | 21ffa7c4baaed6913cd1255b0e60f52c2cc9f196 (diff) | |
download | micropython-2ff2ea5f3b1904834b287e74415f329b31d9a3db.tar.gz micropython-2ff2ea5f3b1904834b287e74415f329b31d9a3db.zip |
vm: Handle "raise X from Y" statements the best way we can.
By issuing a warning that exception chaining is not supported, and ignoring
"from Y" argument.
Diffstat (limited to 'py/vm.c')
-rw-r--r-- | py/vm.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1048,7 +1048,11 @@ unwind_return: MARK_EXC_IP_SELECTIVE(); mp_uint_t unum = *ip++; mp_obj_t obj; - assert(unum <= 1); + if (unum == 2) { + mp_warning("exception chaining not supported"); + // ignore (pop) "from" argument + sp--; + } if (unum == 0) { // search for the inner-most previous exception, to reraise it obj = MP_OBJ_NULL; |