Skip to content

Commit 93b373d

Browse files
committed
"pop from empty %q"
Saves 12 bytes code on trinket m0
1 parent 6669ced commit 93b373d

File tree

10 files changed

+11
-12
lines changed

10 files changed

+11
-12
lines changed

locale/circuitpython.pot

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2020-08-04 13:58-0500\n"
11+
"POT-Creation-Date: 2020-08-04 18:42-0500\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -2894,8 +2894,7 @@ msgstr ""
28942894
#: ports/nrf/common-hal/pulseio/PulseIn.c
28952895
#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c
28962896
#: shared-bindings/ps2io/Ps2.c
2897-
#, c-format
2898-
msgid "pop from empty %s"
2897+
msgid "pop from empty %q"
28992898
msgstr ""
29002899

29012900
#: py/objint_mpz.c

ports/atmel-samd/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) {
298298

299299
uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) {
300300
if (self->len == 0) {
301-
mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn");
301+
mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn);
302302
}
303303
common_hal_mcu_disable_interrupts();
304304
uint16_t value = self->buffer[self->start];

ports/cxd56/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) {
160160

161161
uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) {
162162
if (self->len == 0) {
163-
mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn");
163+
mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn);
164164
}
165165
common_hal_mcu_disable_interrupts();
166166
uint16_t value = self->buffer[self->start];

ports/mimxrt10xx/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) {
201201

202202
uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) {
203203
// if (self->len == 0) {
204-
// mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn");
204+
// mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn);
205205
// }
206206
// common_hal_mcu_disable_interrupts();
207207
// uint16_t value = self->buffer[self->start];

ports/nrf/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_
284284

285285
uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) {
286286
if (self->len == 0) {
287-
mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn");
287+
mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn);
288288
}
289289

290290
if ( !self->paused ) {

ports/stm/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_
258258

259259
uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) {
260260
if (self->len == 0) {
261-
mp_raise_IndexError_varg(translate("pop from empty %s"), "PulseIn");
261+
mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn);
262262
}
263263
HAL_NVIC_DisableIRQ(self->irq);
264264
uint16_t value = self->buffer[self->start];

py/objdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ STATIC mp_obj_t dict_popitem(mp_obj_t self_in) {
313313
size_t cur = 0;
314314
mp_map_elem_t *next = dict_iter_next(self, &cur);
315315
if (next == NULL) {
316-
mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %s"), "dict");
316+
mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %q"), MP_QSTR_dict);
317317
}
318318
self->map.used--;
319319
mp_obj_t items[] = {next->key, next->value};

py/objlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ STATIC mp_obj_t list_pop(size_t n_args, const mp_obj_t *args) {
274274
mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_list));
275275
mp_obj_list_t *self = mp_instance_cast_to_native_base(args[0], &mp_type_list);
276276
if (self->len == 0) {
277-
mp_raise_IndexError_varg(translate("pop from empty %s"), "list");
277+
mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_list);
278278
}
279279
size_t index = mp_get_index(self->base.type, self->len, n_args == 1 ? MP_OBJ_NEW_SMALL_INT(-1) : args[1], false);
280280
mp_obj_t ret = self->items[index];

py/objset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ STATIC mp_obj_t set_pop(mp_obj_t self_in) {
368368
mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in);
369369
mp_obj_t obj = mp_set_remove_first(&self->set);
370370
if (obj == MP_OBJ_NULL) {
371-
mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %s"), "set");
371+
mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %q"), MP_QSTR_set);
372372
}
373373
return obj;
374374
}

shared-bindings/ps2io/Ps2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) {
133133

134134
int b = common_hal_ps2io_ps2_popleft(self);
135135
if (b < 0) {
136-
mp_raise_IndexError_varg(translate("pop from empty %s"), "Ps2 buffer");
136+
mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_Ps2_space_buffer);
137137
}
138138
return MP_OBJ_NEW_SMALL_INT(b);
139139
}

0 commit comments

Comments
 (0)