From 6440af5c0670264170145d5b1cffa82fe5376159 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 8 May 2019 14:53:20 -0700 Subject: [PATCH] Hide the traceback for the ReloadException. Many users think it's an error when it's us simply stopping the code. --- lib/utils/pyexec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index e8a1983b02..c8e369e791 100755 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -131,7 +131,9 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input // at the moment, the value of SystemExit is unused ret = pyexec_system_exit; } else { - mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); + if ((mp_obj_t) nlr.ret_val != MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); + } ret = PYEXEC_EXCEPTION; } }