diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-05 19:01:34 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-05 19:01:34 +0100 |
commit | a91ac2011f0131ce550bf227d78ccccbdab4f882 (patch) | |
tree | 4efcd77de48edbf4017307babe46e9e6b1337c17 /qemu-arm/test_main.c | |
parent | 6dba992182af9b3a73711958de2eeeb33b7f69f6 (diff) | |
download | micropython-a91ac2011f0131ce550bf227d78ccccbdab4f882.tar.gz micropython-a91ac2011f0131ce550bf227d78ccccbdab4f882.zip |
py: Make compiler return a proper exception on SyntaxError.
Diffstat (limited to 'qemu-arm/test_main.c')
-rw-r--r-- | qemu-arm/test_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qemu-arm/test_main.c b/qemu-arm/test_main.c index 563e1c91df..099cd94ba1 100644 --- a/qemu-arm/test_main.c +++ b/qemu-arm/test_main.c @@ -39,8 +39,9 @@ inline void do_str(const char *src) { mp_lexer_free(lex); mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, true); - if (module_fun == mp_const_none) { - tt_abort_msg("Computer error"); + if (mp_obj_is_exception_instance(module_fun)) { + mp_obj_print_exception(module_fun); + tt_abort_msg("Compile error"); } nlr_buf_t nlr; |