diff options
Diffstat (limited to 'py/objboundmeth.c')
-rw-r--r-- | py/objboundmeth.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/py/objboundmeth.c b/py/objboundmeth.c index 84d201277f..0f9ff08c81 100644 --- a/py/objboundmeth.c +++ b/py/objboundmeth.c @@ -71,7 +71,11 @@ STATIC mp_obj_t bound_meth_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_ } #if MICROPY_PY_FUNCTION_ATTRS -STATIC void bound_meth_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { +STATIC void bound_meth_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { + if (dest[0] != MP_OBJ_NULL) { + // not load attribute + return; + } if (attr == MP_QSTR___name__) { mp_obj_bound_meth_t *o = self_in; dest[0] = MP_OBJ_NEW_QSTR(mp_obj_fun_get_name(o->meth)); @@ -87,7 +91,7 @@ STATIC const mp_obj_type_t mp_type_bound_meth = { #endif .call = bound_meth_call, #if MICROPY_PY_FUNCTION_ATTRS - .load_attr = bound_meth_load_attr, + .attr = bound_meth_attr, #endif }; |