Skip to content

Commit fdfc442

Browse files
committed
MICROPY_NONSTANDARD_TYPECODES default; check MICROPY_PY_ERRNO in objexcept.c
1 parent 009b3ae commit fdfc442

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

py/mpconfig.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,12 @@ typedef double mp_float_t;
14241424
#define MICROPY_PY_STRUCT (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
14251425
#endif
14261426

1427+
// CIRCUITPY-CHANGE
1428+
// Whether to provide non-standard typecodes in "struct" module
1429+
#ifndef MICROPY_NONSTANDARD_TYPECODES
1430+
#define MICROPY_NONSTANDARD_TYPECODES (1)
1431+
#endif
1432+
14271433
// Whether to provide "sys" module
14281434
#ifndef MICROPY_PY_SYS
14291435
#define MICROPY_PY_SYS (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)

py/objexcept.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ void mp_obj_exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
344344
} else if (attr == MP_QSTR_strerror) {
345345
if (self->args->len > 1) {
346346
dest[0] = self->args->items[1];
347+
#if MICROPY_PY_ERRNO
347348
} else if (self->args->len > 0) {
348349
char decompressed[50];
349350
const char *msg = mp_common_errno_to_str(self->args->items[0], decompressed, sizeof(decompressed));
@@ -352,6 +353,7 @@ void mp_obj_exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
352353
} else {
353354
dest[0] = mp_const_none;
354355
}
356+
#endif
355357
} else {
356358
dest[0] = mp_const_none;
357359
}

0 commit comments

Comments
 (0)