Skip to content

Commit a39fc94

Browse files
committed
Don't long live class attributes
When they are added later, they are also referenced in the main dictionary. Fixes #1218
1 parent 3af57f3 commit a39fc94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/objtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ STATIC void type_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
10651065

10661066
// store attribute
10671067
mp_map_elem_t *elem = mp_map_lookup(locals_map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND);
1068-
elem->value = make_obj_long_lived(dest[1], 10);
1068+
elem->value = dest[1];
10691069
dest[0] = MP_OBJ_NULL; // indicate success
10701070
}
10711071
}

0 commit comments

Comments
 (0)