@@ -373,7 +373,7 @@ mp_obj_t rt_load_name(qstr qstr) {
373373 if (elem == NULL ) {
374374 elem = mp_map_lookup (& map_builtins , MP_OBJ_NEW_QSTR (qstr ), MP_MAP_LOOKUP );
375375 if (elem == NULL ) {
376- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_NameError , "name '%s' is not defined" , qstr_str (qstr )));
376+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_NameError , "name '%s' is not defined" , qstr_str (qstr )));
377377 }
378378 }
379379 }
@@ -387,7 +387,7 @@ mp_obj_t rt_load_global(qstr qstr) {
387387 if (elem == NULL ) {
388388 elem = mp_map_lookup (& map_builtins , MP_OBJ_NEW_QSTR (qstr ), MP_MAP_LOOKUP );
389389 if (elem == NULL ) {
390- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_NameError , "name '%s' is not defined" , qstr_str (qstr )));
390+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_NameError , "name '%s' is not defined" , qstr_str (qstr )));
391391 }
392392 }
393393 return elem -> value ;
@@ -447,7 +447,7 @@ mp_obj_t rt_unary_op(int op, mp_obj_t arg) {
447447 }
448448 }
449449 // TODO specify in error message what the operator is
450- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_TypeError , "bad operand type for unary operator: '%s'" , o -> type -> name ));
450+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "bad operand type for unary operator: '%s'" , o -> type -> name ));
451451 }
452452}
453453
@@ -532,7 +532,7 @@ mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
532532 }
533533
534534 // TODO specify in error message what the operator is
535- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_TypeError , "unsupported operand type for binary operator: '%s'" , mp_obj_get_type_str (lhs )));
535+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "unsupported operand type for binary operator: '%s'" , mp_obj_get_type_str (lhs )));
536536}
537537
538538mp_obj_t rt_compare_op (int op , mp_obj_t lhs , mp_obj_t rhs ) {
@@ -687,7 +687,7 @@ mp_obj_t rt_call_function_n(mp_obj_t fun_in, int n_args, const mp_obj_t *args) {
687687 if (fun -> type -> call_n != NULL ) {
688688 return fun -> type -> call_n (fun_in , n_args , args );
689689 } else {
690- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_TypeError , "'%s' object is not callable" , fun -> type -> name ));
690+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "'%s' object is not callable" , fun -> type -> name ));
691691 }
692692 }
693693}
@@ -705,7 +705,7 @@ mp_obj_t rt_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp
705705 if (fun -> type -> call_n_kw != NULL ) {
706706 return fun -> type -> call_n_kw (fun_in , n_args , n_kw , args );
707707 } else {
708- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_TypeError , "'%s' object is not callable" , fun -> type -> name ));
708+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "'%s' object is not callable" , fun -> type -> name ));
709709 }
710710 }
711711}
@@ -754,14 +754,14 @@ void rt_unpack_sequence(mp_obj_t seq_in, uint num, mp_obj_t *items) {
754754 mp_obj_list_get (seq_in , & seq_len , & seq_items );
755755 }
756756 if (seq_len < num ) {
757- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_ValueError , "need more than %d values to unpack" , (void * )(machine_uint_t )seq_len ));
757+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_ValueError , "need more than %d values to unpack" , (void * )(machine_uint_t )seq_len ));
758758 } else if (seq_len > num ) {
759- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_ValueError , "too many values to unpack (expected %d)" , (void * )(machine_uint_t )num ));
759+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_ValueError , "too many values to unpack (expected %d)" , (void * )(machine_uint_t )num ));
760760 }
761761 memcpy (items , seq_items , num * sizeof (mp_obj_t ));
762762 } else {
763763 // TODO call rt_getiter and extract via rt_iternext
764- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_TypeError , "'%s' object is not iterable" , mp_obj_get_type_str (seq_in )));
764+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "'%s' object is not iterable" , mp_obj_get_type_str (seq_in )));
765765 }
766766}
767767
@@ -807,7 +807,7 @@ mp_obj_t rt_load_attr(mp_obj_t base, qstr attr) {
807807 }
808808
809809no_attr :
810- nlr_jump (mp_obj_new_exception_msg_2_args (MP_QSTR_AttributeError , "'%s' object has no attribute '%s'" , mp_obj_get_type_str (base ), qstr_str (attr )));
810+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_AttributeError , "'%s' object has no attribute '%s'" , mp_obj_get_type_str (base ), qstr_str (attr )));
811811}
812812
813813void rt_load_method (mp_obj_t base , qstr attr , mp_obj_t * dest ) {
@@ -852,7 +852,7 @@ void rt_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) {
852852 mp_map_t * globals = mp_obj_module_get_globals (base );
853853 mp_map_lookup (globals , MP_OBJ_NEW_QSTR (attr ), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND )-> value = value ;
854854 } else {
855- nlr_jump (mp_obj_new_exception_msg_2_args (MP_QSTR_AttributeError , "'%s' object has no attribute '%s'" , mp_obj_get_type_str (base ), qstr_str (attr )));
855+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_AttributeError , "'%s' object has no attribute '%s'" , mp_obj_get_type_str (base ), qstr_str (attr )));
856856 }
857857}
858858
@@ -877,7 +877,7 @@ mp_obj_t rt_getiter(mp_obj_t o_in) {
877877 if (o -> type -> getiter != NULL ) {
878878 return o -> type -> getiter (o_in );
879879 } else {
880- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_TypeError , "'%s' object is not iterable" , o -> type -> name ));
880+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "'%s' object is not iterable" , o -> type -> name ));
881881 }
882882 }
883883}
@@ -890,7 +890,7 @@ mp_obj_t rt_iternext(mp_obj_t o_in) {
890890 if (o -> type -> iternext != NULL ) {
891891 return o -> type -> iternext (o_in );
892892 } else {
893- nlr_jump (mp_obj_new_exception_msg_1_arg (MP_QSTR_TypeError , "'%s' object is not an iterator" , o -> type -> name ));
893+ nlr_jump (mp_obj_new_exception_msg_varg (MP_QSTR_TypeError , "'%s' object is not an iterator" , o -> type -> name ));
894894 }
895895 }
896896}
0 commit comments