Skip to content

Commit 36a8828

Browse files
authored
Merge pull request #3632 from dhalbert/add-binascii
add binascii to most builds
2 parents 81bb92b + 72b829d commit 36a8828

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

ports/atmel-samd/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
// MICROPY_PY_UJSON depends on MICROPY_PY_IO
4848
#define MICROPY_PY_IO (0)
4949
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
50+
#define MICROPY_PY_UBINASCII (0)
5051
#define MICROPY_PY_UJSON (0)
5152
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0)
5253
#define MICROPY_PY_UERRNO_LIST \

py/circuitpy_mpconfig.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ typedef long mp_off_t;
197197
#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT
198198
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD)
199199
#endif
200+
#ifndef MICROPY_PY_UBINASCII
201+
#define MICROPY_PY_UBINASCII (CIRCUITPY_FULL_BUILD)
202+
#endif
200203
// Opposite setting is deliberate.
201204
#define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD)
202205
#ifndef MICROPY_PY_URE
@@ -699,6 +702,12 @@ extern const struct _mp_obj_module_t ustack_module;
699702
#endif
700703

701704
// These modules are not yet in shared-bindings, but we prefer the non-uxxx names.
705+
#if MICROPY_PY_UBINASCII
706+
#define BINASCII_MODULE { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) },
707+
#else
708+
#define BINASCII_MODULE
709+
#endif
710+
702711
#if MICROPY_PY_UERRNO
703712
#define ERRNO_MODULE { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mp_module_uerrno) },
704713
#else
@@ -770,6 +779,7 @@ extern const struct _mp_obj_module_t wifi_module;
770779
AUDIOMIXER_MODULE \
771780
AUDIOMP3_MODULE \
772781
AUDIOPWMIO_MODULE \
782+
BINASCII_MODULE \
773783
BITBANGIO_MODULE \
774784
BLEIO_MODULE \
775785
BOARD_MODULE \

py/objmodule.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,12 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
239239
{ MP_ROM_QSTR(MP_QSTR_hashlib), MP_ROM_PTR(&mp_module_uhashlib) },
240240
#endif
241241
#if MICROPY_PY_UBINASCII
242-
{ MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) },
242+
#if CIRCUITPY
243+
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
244+
// TODO: move to shared-bindings/
245+
#else
246+
{ MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) },
247+
#endif
243248
#endif
244249
#if MICROPY_PY_URANDOM
245250
{ MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&mp_module_urandom) },

0 commit comments

Comments
 (0)