Skip to content

Commit b5cef5c

Browse files
kaspar030dpgeorge
authored andcommitted
py/objobject: Don't make locals_dict if there's nothing to go in it.
1 parent cf5112b commit b5cef5c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

py/objobject.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ STATIC mp_obj_t object___new__(mp_obj_t cls) {
5959
}
6060
STATIC MP_DEFINE_CONST_FUN_OBJ_1(object___new___fun_obj, object___new__);
6161
STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(object___new___obj, (const mp_obj_t)&object___new___fun_obj);
62-
#endif
6362

6463
STATIC const mp_map_elem_t object_locals_dict_table[] = {
6564
#if MICROPY_CPYTHON_COMPAT
@@ -71,10 +70,13 @@ STATIC const mp_map_elem_t object_locals_dict_table[] = {
7170
};
7271

7372
STATIC MP_DEFINE_CONST_DICT(object_locals_dict, object_locals_dict_table);
73+
#endif
7474

7575
const mp_obj_type_t mp_type_object = {
7676
{ &mp_type_type },
7777
.name = MP_QSTR_object,
7878
.make_new = object_make_new,
79+
#if MICROPY_CPYTHON_COMPAT
7980
.locals_dict = (mp_obj_t)&object_locals_dict,
81+
#endif
8082
};

0 commit comments

Comments
 (0)