py: Allow retrieving a function's __name__.

Disabled by default.  Enabled on unix and stmhal ports.
This commit is contained in:
stijn
2015-02-14 18:44:31 +01:00
committed by Damien George
parent 07b8dc68d6
commit 3cc17c69ff
9 changed files with 54 additions and 8 deletions

View File

@@ -62,7 +62,7 @@ STATIC NORETURN void fun_pos_args_mismatch(mp_obj_fun_bc_t *f, mp_uint_t expecte
#elif MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
"%s() takes %d positional arguments but %d were given",
mp_obj_fun_get_name(f), expected, given));
qstr_str(mp_obj_fun_get_name(f)), expected, given));
#endif
}