diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-08-08 18:24:49 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-08-09 13:29:30 -0700 |
| commit | 96ebf5bc3fb455162286b9bc31e763f3c4f1c457 (patch) | |
| tree | 3d06bc866bcf943a0e0ea881a1fcab9826291a1c /py/objfloat.c | |
| parent | 9da79c880e387ab05a683b67feb8f3da600d937d (diff) | |
Two fixes and translate more strings.
* Fix finding translations with escaped characters.
* Add back \r to translations since its needed by screen.
Diffstat (limited to 'py/objfloat.c')
| -rw-r--r-- | py/objfloat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/py/objfloat.c b/py/objfloat.c index 16aa9bc20..c3f47018c 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -32,6 +32,8 @@ #include "py/parsenum.h" #include "py/runtime.h" +#include "supervisor/shared/translate.h" + #if MICROPY_PY_BUILTINS_FLOAT #include <math.h> @@ -265,7 +267,7 @@ mp_obj_t mp_obj_float_binary_op(mp_binary_op_t op, mp_float_t lhs_val, mp_obj_t case MP_BINARY_OP_INPLACE_FLOOR_DIVIDE: if (rhs_val == 0) { zero_division_error: - mp_raise_msg(&mp_type_ZeroDivisionError, "division by zero"); + mp_raise_msg(&mp_type_ZeroDivisionError, translate("division by zero")); } // Python specs require that x == (x//y)*y + (x%y) so we must // call divmod to compute the correct floor division, which @@ -303,7 +305,7 @@ mp_obj_t mp_obj_float_binary_op(mp_binary_op_t op, mp_float_t lhs_val, mp_obj_t #if MICROPY_PY_BUILTINS_COMPLEX return mp_obj_complex_binary_op(MP_BINARY_OP_POWER, lhs_val, 0, rhs_in); #else - mp_raise_ValueError("complex values not supported"); + mp_raise_ValueError(translate("complex values not supported")); #endif } lhs_val = MICROPY_FLOAT_C_FUN(pow)(lhs_val, rhs_val); |
