diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-19 12:38:49 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-19 12:38:49 +0000 |
commit | 136b149e417314e5ad46b3ee78b811df57e74f41 (patch) | |
tree | 203a941101aae04a8e20028c5301286da5ba87b4 /unix/main.c | |
parent | 49f6a99c65943c6b040e7237f7b86cbe184826c0 (diff) | |
download | micropython-136b149e417314e5ad46b3ee78b811df57e74f41.tar.gz micropython-136b149e417314e5ad46b3ee78b811df57e74f41.zip |
py: Add full traceback to exception printing.
Diffstat (limited to 'unix/main.c')
-rw-r--r-- | unix/main.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/unix/main.c b/unix/main.c index 35fca2059a..b39ed4f2c7 100644 --- a/unix/main.c +++ b/unix/main.c @@ -73,15 +73,7 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind nlr_pop(); } else { // uncaught exception - mp_obj_t exc = (mp_obj_t)nlr.ret_val; - if (MP_OBJ_IS_TYPE(exc, &exception_type)) { - qstr file, block; - machine_uint_t line; - mp_obj_exception_get_source_info(exc, &file, &line, &block); - printf("File \"%s\", line %d, in %s\n", qstr_str(file), (int)line, qstr_str(block)); - } - mp_obj_print(exc, PRINT_REPR); - printf("\n"); + mp_obj_print_exception((mp_obj_t)nlr.ret_val); } } |