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.
This commit is contained in:
Paul Sokolovsky 2015-09-01 10:35:58 +03:00
parent 21ffa7c4ba
commit 2ff2ea5f3b
1 changed files with 5 additions and 1 deletions

View File

@ -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;