Skip to content

Commit 2ff2ea5

Browse files
committed
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.
1 parent 21ffa7c commit 2ff2ea5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

py/vm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,11 @@ unwind_jump:;
10481048
MARK_EXC_IP_SELECTIVE();
10491049
mp_uint_t unum = *ip++;
10501050
mp_obj_t obj;
1051-
assert(unum <= 1);
1051+
if (unum == 2) {
1052+
mp_warning("exception chaining not supported");
1053+
// ignore (pop) "from" argument
1054+
sp--;
1055+
}
10521056
if (unum == 0) {
10531057
// search for the inner-most previous exception, to reraise it
10541058
obj = MP_OBJ_NULL;

0 commit comments

Comments
 (0)