@@ -48,19 +48,9 @@ int main(int argc, char **argv) {
48
48
gc_init (heap , heap + sizeof (heap ));
49
49
#endif
50
50
mp_init ();
51
- #if MICROPY_REPL_EVENT_DRIVEN
52
- pyexec_event_repl_init ();
53
- for (;;) {
54
- int c = mp_hal_stdin_rx_chr ();
55
- if (pyexec_event_repl_process_char (c )) {
56
- break ;
57
- }
58
- }
59
- #else
51
+
60
52
pyexec_friendly_repl ();
61
- #endif
62
- //do_str("print('hello world!', list(x+1 for x in range(10)), end='eol\\n')", MP_PARSE_SINGLE_INPUT);
63
- //do_str("for i in range(10):\r\n print(i)", MP_PARSE_FILE_INPUT);
53
+
64
54
mp_deinit ();
65
55
return 0 ;
66
56
}
@@ -88,13 +78,16 @@ mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) {
88
78
}
89
79
MP_DEFINE_CONST_FUN_OBJ_KW (mp_builtin_open_obj , 1 , mp_builtin_open );
90
80
91
- void nlr_jump_fail (void * val ) {
92
- }
93
-
94
81
void NORETURN __fatal_error (const char * msg ) {
95
82
while (1 );
96
83
}
97
84
85
+ void nlr_jump_fail (void * val ) {
86
+ printf ("FATAL: uncaught exception %p\n" , val );
87
+ mp_obj_print_exception (& mp_plat_print , (mp_obj_t )val );
88
+ __fatal_error ("" );
89
+ }
90
+
98
91
#ifndef NDEBUG
99
92
void MP_WEAK __assert_func (const char * file , int line , const char * func , const char * expr ) {
100
93
printf ("Assertion '%s' failed, at file %s:%d\n" , expr , file , line );
0 commit comments