diff options
| author | Noralf Trønnes <noralf@tronnes.org> | 2018-08-18 16:00:06 +0200 |
|---|---|---|
| committer | Noralf Trønnes <noralf@tronnes.org> | 2018-08-18 16:00:06 +0200 |
| commit | eefb6842a02fede247d144ee9f29876efd584f7e (patch) | |
| tree | 7b7f134a1edc45cf46536a3c6477046c20e4a418 /shared-bindings | |
| parent | 1a6f6ff8e44688b2cd49ab6b6170d17cdf23fb23 (diff) | |
i2cslave: Fix missing translate() when raising exceptions
The translate() changes where applied after travis had checked the
i2cslave PR so this wasn't caught.
Diffstat (limited to 'shared-bindings')
| -rw-r--r-- | shared-bindings/i2cslave/I2CSlave.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index 2f3646d57..d2e001e4c 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -95,16 +95,16 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ while ((item = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { mp_int_t value; if (!mp_obj_get_int_maybe(item, &value)) { - mp_raise_TypeError("can't convert address to int"); + mp_raise_TypeError(translate("can't convert address to int")); } if (value < 0x00 || value > 0x7f) { - mp_raise_ValueError("address out of bounds"); + mp_raise_ValueError(translate("address out of bounds")); } addresses = m_renew(uint8_t, addresses, i, i + 1); addresses[i++] = value; } if (i == 0) { - mp_raise_ValueError("addresses is empty"); + mp_raise_ValueError(translate("addresses is empty")); } common_hal_i2cslave_i2c_slave_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); |
