diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-01 15:33:50 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-01 15:33:50 +0000 |
commit | 7f23384d4920f7d1a4ea743a51a2d54fd0889e72 (patch) | |
tree | f6f46cda8f8173e329a6a53b67358d5203b521a4 /py/bc.c | |
parent | 276159e5ddedfdb863bf34e4ae25c58621af5750 (diff) |
py: Make terse_arg_mismatch a global function and use it elsewhere.
Reduces code size when MICROPY_ERROR_REPORTING_TERSE is selected.
Diffstat (limited to 'py/bc.c')
-rw-r--r-- | py/bc.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -62,9 +62,8 @@ mp_uint_t mp_decode_uint(const byte **ptr) { 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)); |