diff options
| author | Dan Halbert <halbert@halwitz.org> | 2018-08-09 20:00:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-09 20:00:18 -0400 |
| commit | bbc034cd3dfc46ee7938faedc915fec91610c6a3 (patch) | |
| tree | 4fe11d359088e41790030fce0763471b76ab3fb4 /py/objcomplex.c | |
| parent | b735b9dbed2132f07793324a40770f4bd96d9ae8 (diff) | |
| parent | 24e53ad5911f42efb6508b4a8dcf4a196a81494a (diff) | |
Merge pull request #1104 from tannewt/more_strings
Fixes and translate more strings.
Diffstat (limited to 'py/objcomplex.c')
| -rw-r--r-- | py/objcomplex.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/py/objcomplex.c b/py/objcomplex.c index 261c2b1f0..3336d7b05 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -31,6 +31,8 @@ #include "py/parsenum.h" #include "py/runtime.h" +#include "supervisor/shared/translate.h" + #if MICROPY_PY_BUILTINS_COMPLEX #include <math.h> @@ -198,13 +200,13 @@ mp_obj_t mp_obj_complex_binary_op(mp_binary_op_t op, mp_float_t lhs_real, mp_flo } case MP_BINARY_OP_FLOOR_DIVIDE: case MP_BINARY_OP_INPLACE_FLOOR_DIVIDE: - mp_raise_TypeError("can't do truncated division of a complex number"); + mp_raise_TypeError(translate("can't do truncated division of a complex number")); case MP_BINARY_OP_TRUE_DIVIDE: case MP_BINARY_OP_INPLACE_TRUE_DIVIDE: if (rhs_imag == 0) { if (rhs_real == 0) { - mp_raise_msg(&mp_type_ZeroDivisionError, "complex division by zero"); + mp_raise_msg(&mp_type_ZeroDivisionError, translate("complex division by zero")); } lhs_real /= rhs_real; lhs_imag /= rhs_real; @@ -232,7 +234,7 @@ mp_obj_t mp_obj_complex_binary_op(mp_binary_op_t op, mp_float_t lhs_real, mp_flo if (rhs_imag == 0 && rhs_real >= 0) { lhs_real = (rhs_real == 0); } else { - mp_raise_msg(&mp_type_ZeroDivisionError, "0.0 to a complex power"); + mp_raise_msg(&mp_type_ZeroDivisionError, translate("0.0 to a complex power")); } } else { mp_float_t ln1 = MICROPY_FLOAT_C_FUN(log)(abs1); |
