summaryrefslogtreecommitdiffstatshomepage
path: root/py/vm.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-09-01 10:35:58 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-09-01 10:39:04 +0300
commit2ff2ea5f3b1904834b287e74415f329b31d9a3db (patch)
tree2e6a0d290bd9a3e62029b2e8982c531a866faac5 /py/vm.c
parent21ffa7c4baaed6913cd1255b0e60f52c2cc9f196 (diff)
downloadmicropython-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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/vm.c b/py/vm.c
index 08749af21b..2611be683a 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -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;