summaryrefslogtreecommitdiff
path: root/qemu-arm/test_main.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-12-06 14:29:09 +0200
committerDamien George <damien.p.george@gmail.com>2014-12-08 20:25:49 +0000
commit46c3ab20049af16e97863e90e5761fae329f872a (patch)
treecbe6230dcad6972d7d50c6d08c4e4c4da215abb1 /qemu-arm/test_main.c
parentd0caaadaeea48e8f76dca3125a2dea3465a58416 (diff)
modsys: Add sys.print_exception(exc, file=sys.stdout) function.
The function is modeled after traceback.print_exception(), but unbloated, and put into existing module to save overhead on adding another module. Compliant traceback.print_exception() is intended to be implemented in micropython-lib in terms of sys.print_exception(). This change required refactoring mp_obj_print_exception() to take pfenv_t interface arguments. Addresses #751.
Diffstat (limited to 'qemu-arm/test_main.c')
-rw-r--r--qemu-arm/test_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qemu-arm/test_main.c b/qemu-arm/test_main.c
index fb9513077..ea9b0408f 100644
--- a/qemu-arm/test_main.c
+++ b/qemu-arm/test_main.c
@@ -40,7 +40,7 @@ inline void do_str(const char *src) {
mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, true);
if (mp_obj_is_exception_instance(module_fun)) {
- mp_obj_print_exception(module_fun);
+ mp_obj_print_exception(printf_wrapper, NULL, module_fun);
tt_abort_msg("Compile error");
}
@@ -49,7 +49,7 @@ inline void do_str(const char *src) {
mp_call_function_0(module_fun);
nlr_pop();
} else {
- mp_obj_print_exception((mp_obj_t)nlr.ret_val);
+ mp_obj_print_exception(printf_wrapper, NULL, (mp_obj_t)nlr.ret_val);
tt_abort_msg("Uncaught exception");
}
end: