diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-10-05 22:25:36 +0100 | 
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-10-05 22:25:36 +0100 | 
| commit | 854c8c015303d709d3b33f5897dbeff0c10bee9d (patch) | |
| tree | 3c104ace827c337fcbc9d56738f67aeef53267d5 /unix | |
| parent | d03c6816083c8ce8a35d278ede48c4089012b055 (diff) | |
unix: Detect and print compile error.
Diffstat (limited to 'unix')
| -rw-r--r-- | unix/main.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/unix/main.c b/unix/main.c index 12ddfbb09..51a741841 100644 --- a/unix/main.c +++ b/unix/main.c @@ -113,8 +113,9 @@ STATIC int execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind,      mp_obj_t module_fun = mp_compile(pn, source_name, emit_opt, is_repl); -    if (module_fun == mp_const_none) { +    if (mp_obj_is_exception_instance(module_fun)) {          // compile error +        mp_obj_print_exception(module_fun);          return 1;      }  | 
