From dddd25a776fb0d9c002c1b6b039e24bb3048e6ff Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 1 Aug 2020 12:14:55 -0500 Subject: Combine similar strings to reduce size of translations This is a slight trade-off with code size, in places where a "_varg" mp_raise variant is now used. The net savings on trinket_m0 is just 32 bytes. It also means that the translation will include the original English text, and cannot be translated. These are usually names of Python types such as int, set, or dict or special values such as "inf" or "Nan". --- py/objlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objlist.c') diff --git a/py/objlist.c b/py/objlist.c index 9242020d4..b2de72374 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -274,7 +274,7 @@ STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) { mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list); if (self->len == 0) { - mp_raise_IndexError(translate("pop from empty list")); + mp_raise_IndexError_varg(translate("pop from empty %s"), "list"); } size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false); mp_obj_t ret = self->items[index]; -- cgit v1.2.3