summaryrefslogtreecommitdiff
path: root/shared-bindings/struct/__init__.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared-bindings/struct/__init__.c')
-rw-r--r--shared-bindings/struct/__init__.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c
index 5be255971..093597785 100644
--- a/shared-bindings/struct/__init__.c
+++ b/shared-bindings/struct/__init__.c
@@ -36,6 +36,7 @@
#include "py/parsenum.h"
#include "shared-bindings/struct/__init__.h"
#include "shared-module/struct/__init__.h"
+#include "supervisor/shared/translate.h"
//| :mod:`struct` --- manipulation of c-style data
//| ========================================================
@@ -85,7 +86,6 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) {
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_obj, 1, MP_OBJ_FUN_ARGS_MAX, struct_pack);
-
//| .. function:: pack_into(fmt, buffer, offset, v1, v2, ...)
//|
//| Pack the values v1, v2, ... according to the format string fmt into a buffer
@@ -100,7 +100,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) {
// negative offsets are relative to the end of the buffer
offset = (mp_int_t)bufinfo.len + offset;
if (offset < 0) {
- mp_raise_RuntimeError("buffer too small");
+ mp_raise_RuntimeError(translate("buffer too small"));
}
}
byte *p = (byte *)bufinfo.buf;
@@ -142,7 +142,7 @@ STATIC mp_obj_t struct_unpack_from(size_t n_args, const mp_obj_t *args) {
// negative offsets are relative to the end of the buffer
offset = bufinfo.len + offset;
if (offset < 0) {
- mp_raise_RuntimeError("buffer too small");
+ mp_raise_RuntimeError(translate("buffer too small"));
}
}
p += offset;