From a39fc94dde9cd73329130014eb504482591b5a53 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 1 Feb 2019 16:04:16 -0800 Subject: Don't long live class attributes When they are added later, they are also referenced in the main dictionary. Fixes #1218 --- py/objtype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objtype.c') diff --git a/py/objtype.c b/py/objtype.c index f7fe3b3f6..fec99da1a 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -1065,7 +1065,7 @@ STATIC void type_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { // store attribute mp_map_elem_t *elem = mp_map_lookup(locals_map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND); - elem->value = make_obj_long_lived(dest[1], 10); + elem->value = dest[1]; dest[0] = MP_OBJ_NULL; // indicate success } } -- cgit v1.2.3