aboutsummaryrefslogtreecommitdiff
path: root/py/objobject.c
diff options
context:
space:
mode:
authorKaspar Schleiser <kaspar@schleiser.de>2015-05-09 21:49:23 +0200
committerDamien George <damien.p.george@gmail.com>2015-05-17 17:48:47 +0100
commitb5cef5c7ea2d4bf3564938a679756a8be8c00d39 (patch)
treeaf606c7052b557567a66985d935c481a83a7fcb1 /py/objobject.c
parentcf5112b26f3e6e96480234d50b2c781663d971c2 (diff)
py/objobject: Don't make locals_dict if there's nothing to go in it.
Diffstat (limited to 'py/objobject.c')
-rw-r--r--py/objobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/objobject.c b/py/objobject.c
index 7288ac946..6150374f7 100644
--- a/py/objobject.c
+++ b/py/objobject.c
@@ -59,7 +59,6 @@ STATIC mp_obj_t object___new__(mp_obj_t cls) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(object___new___fun_obj, object___new__);
STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(object___new___obj, (const mp_obj_t)&object___new___fun_obj);
-#endif
STATIC const mp_map_elem_t object_locals_dict_table[] = {
#if MICROPY_CPYTHON_COMPAT
@@ -71,10 +70,13 @@ STATIC const mp_map_elem_t object_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(object_locals_dict, object_locals_dict_table);
+#endif
const mp_obj_type_t mp_type_object = {
{ &mp_type_type },
.name = MP_QSTR_object,
.make_new = object_make_new,
+ #if MICROPY_CPYTHON_COMPAT
.locals_dict = (mp_obj_t)&object_locals_dict,
+ #endif
};