Skip to content

Commit d39d146

Browse files
committed
Merge some messages
1 parent d61fde3 commit d39d146

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

locale/circuitpython.pot

100755100644
Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ msgstr ""
189189
msgid "%q pin invalid"
190190
msgstr ""
191191

192+
#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c
193+
msgid "%q step cannot be zero"
194+
msgstr ""
195+
192196
#: py/bc.c py/objnamedtuple.c
193197
msgid "%q() takes %d positional arguments but %d were given"
194198
msgstr ""
@@ -2846,7 +2850,7 @@ msgstr ""
28462850
msgid "div/mod not implemented for uint"
28472851
msgstr ""
28482852

2849-
#: py/runtime.c shared-bindings/math/__init__.c
2853+
#: py/runtime.c
28502854
msgid "division by zero"
28512855
msgstr ""
28522856

@@ -3218,10 +3222,6 @@ msgstr ""
32183222
msgid "inputs are not iterable"
32193223
msgstr ""
32203224

3221-
#: py/parsenum.c
3222-
msgid "int() arg 2 must be >= 2 and <= 36"
3223-
msgstr ""
3224-
32253225
#: extmod/ulab/code/numpy/approx.c
32263226
msgid "interp is defined for 1D iterables of equal length"
32273227
msgstr ""
@@ -3359,10 +3359,6 @@ msgstr ""
33593359
msgid "local variable referenced before assignment"
33603360
msgstr ""
33613361

3362-
#: py/objint.c
3363-
msgid "long int not supported in this build"
3364-
msgstr ""
3365-
33663362
#: ports/espressif/common-hal/canio/CAN.c
33673363
msgid "loopback + silent mode not supported by peripheral"
33683364
msgstr ""
@@ -3897,10 +3893,6 @@ msgstr ""
38973893
msgid "slice step can't be zero"
38983894
msgstr ""
38993895

3900-
#: py/objslice.c
3901-
msgid "slice step cannot be zero"
3902-
msgstr ""
3903-
39043896
#: py/nativeglue.c
39053897
msgid "slice unsupported"
39063898
msgstr ""
@@ -3949,10 +3941,6 @@ msgstr ""
39493941
msgid "start/end indices"
39503942
msgstr ""
39513943

3952-
#: shared-bindings/random/__init__.c
3953-
msgid "step must be non-zero"
3954-
msgstr ""
3955-
39563944
#: shared-bindings/random/__init__.c
39573945
msgid "stop not reachable from start"
39583946
msgstr ""
@@ -4278,10 +4266,6 @@ msgstr ""
42784266
msgid "y value out of bounds"
42794267
msgstr ""
42804268

4281-
#: py/objrange.c
4282-
msgid "zero step"
4283-
msgstr ""
4284-
42854269
#: extmod/ulab/code/scipy/signal/signal.c
42864270
msgid "zi must be an ndarray"
42874271
msgstr ""

py/objrange.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ STATIC mp_obj_t range_make_new(const mp_obj_type_t *type, size_t n_args, size_t
110110
if (n_args == 3) {
111111
o->step = mp_obj_get_int(args[2]);
112112
if (o->step == 0) {
113-
mp_raise_ValueError(MP_ERROR_TEXT("zero step"));
113+
mp_raise_ValueError_varg(MP_ERROR_TEXT("%q step cannot be zero"), MP_QSTR_range);
114114
}
115115
}
116116
}

py/objslice.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void mp_obj_slice_indices(mp_obj_t self_in, mp_int_t length, mp_bound_slice_t *r
157157
} else {
158158
step = mp_obj_get_int(self->step);
159159
if (step == 0) {
160-
mp_raise_ValueError(MP_ERROR_TEXT("slice step cannot be zero"));
160+
mp_raise_ValueError_varg(MP_ERROR_TEXT("%q step cannot be zero"), MP_QSTR_slice);
161161
}
162162
}
163163

shared-bindings/random/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) {
108108
} else if (step < 0) {
109109
n = (stop - start + step + 1) / step;
110110
} else {
111-
mp_raise_ValueError(translate("step must be non-zero"));
111+
mp_raise_ValueError_varg(MP_ERROR_TEXT("%q step cannot be zero"), MP_QSTR_randrange);
112112
}
113113
if (n <= 0) {
114114
mp_raise_ValueError(translate("invalid step"));

0 commit comments

Comments
 (0)