From 96ebf5bc3fb455162286b9bc31e763f3c4f1c457 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 8 Aug 2018 18:24:49 -0700 Subject: Two fixes and translate more strings. * Fix finding translations with escaped characters. * Add back \r to translations since its needed by screen. --- py/sequence.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'py/sequence.c') diff --git a/py/sequence.c b/py/sequence.c index c66fde98f..cc31be983 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -28,6 +28,7 @@ #include #include "py/runtime.h" +#include "supervisor/shared/translate.h" // Helpers for sequence types @@ -53,7 +54,7 @@ bool mp_seq_get_fast_slice_indexes(mp_uint_t len, mp_obj_t slice, mp_bound_slice if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) { indexes->step = mp_obj_get_int(ostep); if (indexes->step == 0) { - mp_raise_ValueError("slice step cannot be zero"); + mp_raise_ValueError(translate("slice step cannot be zero")); } } else { indexes->step = 1; @@ -260,7 +261,7 @@ mp_obj_t mp_seq_index_obj(const mp_obj_t *items, size_t len, size_t n_args, cons } } - mp_raise_ValueError("object not in sequence"); + mp_raise_ValueError(translate("object not in sequence")); } mp_obj_t mp_seq_count_obj(const mp_obj_t *items, size_t len, mp_obj_t value) { -- cgit v1.2.3