summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2019-02-01 16:04:16 -0800
committerScott Shawcroft <scott@tannewt.org>2019-02-01 16:04:16 -0800
commita39fc94dde9cd73329130014eb504482591b5a53 (patch)
treecc008c00a6d5329006e8c4e85db11376d378a400
parent3af57f3e92cf26648beb51cf91559810d7968305 (diff)
Don't long live class attributes
When they are added later, they are also referenced in the main dictionary. Fixes #1218
-rw-r--r--py/objtype.c2
1 files changed, 1 insertions, 1 deletions
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
}
}