diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-08-16 13:34:12 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-08-16 17:41:35 -0700 |
| commit | 2cd166b57370ab4877ec2d9666225faeac6127ce (patch) | |
| tree | 645f851b1121ce7f52f4b4cf894844e965c4584d /extmod/moduheapq.c | |
| parent | 137a30ad75803255615a422c15ebcd35fbd31130 (diff) | |
Fix esp and samd
Diffstat (limited to 'extmod/moduheapq.c')
| -rw-r--r-- | extmod/moduheapq.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index 71c15368b..db17e8ca2 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -27,13 +27,15 @@ #include "py/objlist.h" #include "py/runtime.h" +#include "supervisor/shared/translate.h" + #if MICROPY_PY_UHEAPQ // the algorithm here is modelled on CPython's heapq.py STATIC mp_obj_list_t *get_heap(mp_obj_t heap_in) { if (!MP_OBJ_IS_TYPE(heap_in, &mp_type_list)) { - mp_raise_TypeError("heap must be a list"); + mp_raise_TypeError(translate("heap must be a list")); } return MP_OBJ_TO_PTR(heap_in); } @@ -81,7 +83,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_uheapq_heappush_obj, mod_uheapq_heappush); STATIC mp_obj_t mod_uheapq_heappop(mp_obj_t heap_in) { mp_obj_list_t *heap = get_heap(heap_in); if (heap->len == 0) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, "empty heap")); + nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, translate("empty heap"))); } mp_obj_t item = heap->items[0]; heap->len -= 1; |
