@@ -226,7 +226,7 @@ void rt_assign_native_code(int unique_code_id, void *fun, uint len, int n_args)
226226 unique_codes [unique_code_id ].is_generator = false;
227227 unique_codes [unique_code_id ].u_native .fun = fun ;
228228
229- printf ("native code: %d bytes\n" , len );
229+ // printf("native code: %d bytes\n", len);
230230
231231#ifdef DEBUG_PRINT
232232 DEBUG_printf ("assign native code: id=%d fun=%p len=%u n_args=%d\n" , unique_code_id , fun , len , n_args );
@@ -421,8 +421,7 @@ mp_obj_t rt_load_build_class(void) {
421421 DEBUG_OP_printf ("load_build_class\n" );
422422 mp_map_elem_t * elem = mp_qstr_map_lookup (& map_builtins , rt_q___build_class__ , false);
423423 if (elem == NULL ) {
424- printf ("name doesn't exist: __build_class__\n" );
425- assert (0 );
424+ nlr_jump (mp_obj_new_exception_msg (rt_q_NameError , "name '__build_class__' is not defined" ));
426425 }
427426 return elem -> value ;
428427}
@@ -525,7 +524,7 @@ mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
525524 break ;
526525 }
527526
528- default : printf ( "%d\n" , op ); assert (0 );
527+ default : assert (0 );
529528 }
530529 if (fit_small_int (lhs_val )) {
531530 return MP_OBJ_NEW_SMALL_INT (lhs_val );
@@ -831,8 +830,7 @@ void rt_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) {
831830 } else if (MP_OBJ_IS_TYPE (base , & instance_type )) {
832831 mp_obj_instance_store_attr (base , attr , value );
833832 } else {
834- printf ("?AttributeError: '%s' object has no attribute '%s'\n" , mp_obj_get_type_str (base ), qstr_str (attr ));
835- assert (0 );
833+ nlr_jump (mp_obj_new_exception_msg_2_args (rt_q_AttributeError , "'%s' object has no attribute '%s'" , mp_obj_get_type_str (base ), qstr_str (attr )));
836834 }
837835}
838836
0 commit comments