8000 touch up analogbufio ValueError msg; consolidate with another message · litui/circuitpython@6f8fe1b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f8fe1b

Browse files
committed
touch up analogbufio ValueError msg; consolidate with another message
1 parent 8a568d1 commit 6f8fe1b

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

locale/circuitpython.pot

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ msgstr ""
7979
msgid "%q"
8080
msgstr ""
8181

82-
#: shared-bindings/analogbufio/BufferedIn.c
83-
msgid "%q ``must`` be a bytearray or array of type 'h', 'H', 'b' or 'B'"
84-
msgstr ""
85-
8682
#: shared-bindings/microcontroller/Pin.c
8783
msgid "%q and %q contain duplicate pins"
8884
msgstr ""
@@ -163,6 +159,11 @@ msgstr ""
163159
msgid "%q must be >= 1"
164160
msgstr ""
165161

162+
#: shared-bindings/analogbufio/BufferedIn.c
163+
#: shared-bindings/audiocore/RawSample.c
164+
msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"
165+
msgstr ""
166+
166167
#: py/argcheck.c
167168
msgid "%q must be a string"
168169
msgstr ""
@@ -3878,12 +3879,6 @@ msgstr ""
38783879
msgid "rsplit(None,n)"
38793880
msgstr ""
38803881

3881-
#: shared-bindings/audiocore/RawSample.c
3882-
msgid ""
3883-
"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or "
3884-
"'B'"
3885-
msgstr ""
3886-
38873882
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
38883883
#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c
38893884
msgid "sampling rate out of range"

shared-bindings/analogbufio/BufferedIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ STATIC mp_obj_t analogbufio_bufferedin_make_new(const mp_obj_type_t *type, size_
9898
if (bufinfo.typecode == 'h' || bufinfo.typecode == 'H') {
9999
bytes_per_sample = 2;
100100
} else if (bufinfo.typecode != 'b' && bufinfo.typecode != 'B' && bufinfo.typecode != BYTEARRAY_TYPECODE) {
101-
mp_raise_ValueError_varg(translate("%q ``must`` be a bytearray or array of type 'h', 'H', 'b' or 'B'"), MP_QSTR_buffer);
101+
mp_raise_ValueError_varg(translate("%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"), MP_QSTR_buffer);
102102
}
103103

104104
// Validate sample rate here

shared-bindings/audiocore/RawSample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a
8888
if (bufinfo.typecode == 'h' || bufinfo.typecode == 'H') {
8989
bytes_per_sample = 2;
9090
} else if (bufinfo.typecode != 'b' && bufinfo.typecode != 'B' && bufinfo.typecode != BYTEARRAY_TYPECODE) {
91-
mp_raise_ValueError(translate("sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or 'B'"));
91+
mp_raise_ValueError_varg(translate("%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"), MP_QSTR_buffer);
9292
}
9393
common_hal_audioio_rawsample_construct(self, ((uint8_t *)bufinfo.buf), bufinfo.len,
9494
bytes_per_sample, signed_samples, args[ARG_channel_count].u_int,

0 commit comments

Comments
 (0)
0