From 20e9ed3916bf0765f49aa6a922cbe061139341c0 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 22 Apr 2014 02:53:20 +0300 Subject: [PATCH] builtinimport: If there was error compiling imported module, raise exception. --- py/builtinimport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/builtinimport.c b/py/builtinimport.c index 4a2f6510c3..07978e61d7 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -122,7 +122,7 @@ void do_load(mp_obj_t module_obj, vstr_t *file) { // TODO handle compile error correctly mp_locals_set(old_locals); mp_globals_set(old_globals); - return; + nlr_raise(mp_obj_new_exception_msg(&mp_type_SyntaxError, "Syntax error in imported module")); } // complied successfully, execute it