summaryrefslogtreecommitdiff
path: root/py/objfun.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-07-10 16:21:34 +1000
committerDamien George <damien.p.george@gmail.com>2018-07-10 16:33:57 +1000
commite2e22e3d7e29985579b2c91c639c71229422f349 (patch)
treec9606c2ac7241209e6620c849a76b97ff39f3dc2 /py/objfun.c
parentee40d1704fc3ec285f0be67ef7010670a1c5c01a (diff)
py/objgenerator: Implement __name__ with normal fun attr accessor code.
With the recent change b488a4a8480533a6a3c9468c2f8bd359c94d4d02, a generating function now has the same layout in memory as a normal bytecode function, and so can reuse the latter's attribute accessor code to implement __name__.
Diffstat (limited to 'py/objfun.c')
-rw-r--r--py/objfun.c4
1 files changed, 2 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
};