summaryrefslogtreecommitdiffstatshomepage
path: root/py/nativeglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/nativeglue.c')
-rw-r--r--py/nativeglue.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c
index d52eeaeaa5..43e7d699ff 100644
--- a/py/nativeglue.c
+++ b/py/nativeglue.c
@@ -80,8 +80,11 @@ mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, mp_uint_t n_args_kw, cons
}
// wrapper that makes raise obj and raises it
-NORETURN void mp_native_raise(mp_obj_t o) {
- nlr_raise(mp_make_raise_obj(o));
+// END_FINALLY opcode requires that we don't raise if o==None
+void mp_native_raise(mp_obj_t o) {
+ if (o != mp_const_none) {
+ nlr_raise(mp_make_raise_obj(o));
+ }
}
// these must correspond to the respective enum in runtime0.h