summaryrefslogtreecommitdiff
path: root/py/objfloat.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-08-09 20:00:18 -0400
committerGitHub <noreply@github.com>2018-08-09 20:00:18 -0400
commitbbc034cd3dfc46ee7938faedc915fec91610c6a3 (patch)
tree4fe11d359088e41790030fce0763471b76ab3fb4 /py/objfloat.c
parentb735b9dbed2132f07793324a40770f4bd96d9ae8 (diff)
parent24e53ad5911f42efb6508b4a8dcf4a196a81494a (diff)
Merge pull request #1104 from tannewt/more_strings
Fixes and translate more strings.
Diffstat (limited to 'py/objfloat.c')
-rw-r--r--py/objfloat.c6
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);