summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/objfun.c4
-rw-r--r--py/objfun.h2
-rw-r--r--py/objgenerator.c3
3 files changed, 7 insertions, 2 deletions
diff --git a/py/objfun.c b/py/objfun.c
index 8c51d92e0..b8657ec95 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -338,7 +338,7 @@ STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const
}
#if MICROPY_PY_FUNCTION_ATTRS
-STATIC void fun_bc_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
+void mp_obj_fun_bc_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
if (dest[0] != MP_OBJ_NULL) {
// not load attribute
return;
@@ -358,7 +358,7 @@ const mp_obj_type_t mp_type_fun_bc = {
.call = fun_bc_call,
.unary_op = mp_generic_unary_op,
#if MICROPY_PY_FUNCTION_ATTRS
- .attr = fun_bc_attr,
+ .attr = mp_obj_fun_bc_attr,
#endif
};
diff --git a/py/objfun.h b/py/objfun.h
index fbb351626..257b8a65a 100644
--- a/py/objfun.h
+++ b/py/objfun.h
@@ -41,4 +41,6 @@ typedef struct _mp_obj_fun_bc_t {
mp_obj_t extra_args[];
} mp_obj_fun_bc_t;
+void mp_obj_fun_bc_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest);
+
#endif // MICROPY_INCLUDED_PY_OBJFUN_H
diff --git a/py/objgenerator.c b/py/objgenerator.c
index 8b898c937..c45bebacd 100644
--- a/py/objgenerator.c
+++ b/py/objgenerator.c
@@ -68,6 +68,9 @@ const mp_obj_type_t mp_type_gen_wrap = {
.name = MP_QSTR_generator,
.call = gen_wrap_call,
.unary_op = mp_generic_unary_op,
+ #if MICROPY_PY_FUNCTION_ATTRS
+ .attr = mp_obj_fun_bc_attr,
+ #endif
};
/******************************************************************************/