From 6a60fb3cf4e2596e5c4bfe9fefefa80e7ccbb71e Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Sat, 21 May 2016 15:41:56 -0700 Subject: [PATCH] py/objstr*: Properly ifdef str.center(). --- py/objstr.c | 2 ++ py/objstrunicode.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/py/objstr.c b/py/objstr.c index ded4498130..69eb2fcefc 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1917,7 +1917,9 @@ STATIC const mp_rom_map_elem_t str8_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&str_count_obj) }, { MP_ROM_QSTR(MP_QSTR_partition), MP_ROM_PTR(&str_partition_obj) }, { MP_ROM_QSTR(MP_QSTR_rpartition), MP_ROM_PTR(&str_rpartition_obj) }, +#if MICROPY_PY_BUILTINS_STR_CENTER { MP_ROM_QSTR(MP_QSTR_center), MP_ROM_PTR(&str_center_obj) }, +#endif { MP_ROM_QSTR(MP_QSTR_lower), MP_ROM_PTR(&str_lower_obj) }, { MP_ROM_QSTR(MP_QSTR_upper), MP_ROM_PTR(&str_upper_obj) }, { MP_ROM_QSTR(MP_QSTR_isspace), MP_ROM_PTR(&str_isspace_obj) }, diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 5e14da451d..c6c775d109 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -238,7 +238,9 @@ STATIC const mp_rom_map_elem_t struni_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&str_count_obj) }, { MP_ROM_QSTR(MP_QSTR_partition), MP_ROM_PTR(&str_partition_obj) }, { MP_ROM_QSTR(MP_QSTR_rpartition), MP_ROM_PTR(&str_rpartition_obj) }, +#if MICROPY_PY_BUILTINS_STR_CENTER { MP_ROM_QSTR(MP_QSTR_center), MP_ROM_PTR(&str_center_obj) }, +#endif { MP_ROM_QSTR(MP_QSTR_lower), MP_ROM_PTR(&str_lower_obj) }, { MP_ROM_QSTR(MP_QSTR_upper), MP_ROM_PTR(&str_upper_obj) }, { MP_ROM_QSTR(MP_QSTR_isspace), MP_ROM_PTR(&str_isspace_obj) },