diff options
| author | Jeff Epler <jepler@gmail.com> | 2020-08-01 12:14:55 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2020-08-04 13:34:29 -0500 |
| commit | dddd25a776fb0d9c002c1b6b039e24bb3048e6ff (patch) | |
| tree | 72406398044fe8064b7e43fcd3c8e16f7a86b6f5 /py/objlist.c | |
| parent | c394af412837f96164ebcc88d5301bece19e4a6f (diff) | |
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".
Diffstat (limited to 'py/objlist.c')
| -rw-r--r-- | py/objlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
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]; |
