From 2ff2ea5f3b1904834b287e74415f329b31d9a3db Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 1 Sep 2015 10:35:58 +0300 Subject: [PATCH] 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. --- py/vm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;