py: Make terse_arg_mismatch a global function and use it elsewhere.
Reduces code size when MICROPY_ERROR_REPORTING_TERSE is selected.
diff --git a/py/bc.c b/py/bc.c
index 47f8d9f..bbc9a20 100644
--- a/py/bc.c
+++ b/py/bc.c
@@ -62,9 +62,8 @@
STATIC NORETURN void fun_pos_args_mismatch(mp_obj_fun_bc_t *f, mp_uint_t expected, mp_uint_t given) {
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE
- // Generic message, to be reused for other argument issues
- nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError,
- "argument num/types mismatch"));
+ // generic message, used also for other argument issues
+ mp_arg_error_terse_mismatch();
#elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NORMAL
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
"function takes %d positional arguments but %d were given", expected, given));