py/objmodule.c: disable new displayio name warnings

This commit is contained in:
Dan Halbert 2024-03-26 16:06:27 -04:00
parent 8feaec49f5
commit 999a4acd9f
2 changed files with 7 additions and 1 deletions

View file

@ -38,6 +38,12 @@
// Always 1: defined in circuitpy_mpconfig.mk
// #define CIRCUITPY (1)
// Can be removed once CircuitPython 10 is released.
// Print warnings or not about deprecated names. See objmodule.c.
#ifndef CIRCUITPY_8_9_WARNINGS
#define CIRCUITPY_8_9_WARNINGS (0)
#endif
// REPR_C encodes qstrs, 31-bit ints, and 30-bit floats in a single 32-bit word.
#ifndef MICROPY_OBJ_REPR
#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C)

View file

@ -66,7 +66,7 @@ STATIC void module_attr_try_delegation(mp_obj_t self_in, qstr attr, mp_obj_t *de
STATIC void module_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
mp_obj_module_t *self = MP_OBJ_TO_PTR(self_in);
if (dest[0] == MP_OBJ_NULL) {
#if CIRCUITPY_DISPLAYIO && CIRCUITPY_WARNINGS
#if CIRCUITPY_8_9_WARNINGS && CIRCUITPY_DISPLAYIO && CIRCUITPY_WARNINGS
if (self == &displayio_module) {
#if CIRCUITPY_BUSDISPLAY
if (attr == MP_QSTR_Display) {