Skip to content

Commit c54490b

Browse files
committed
py: Fix CI-only thread globals access error.
Always include __template__ in builtins table to maintain consistent memory layout between MICROPY_PY_TSTRINGS enabled/disabled builds. Signed-off-by: Koudai Aono <koxudaxi@gmail.com>
1 parent 340c4d5 commit c54490b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

py/modbuiltins.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,6 @@ static const mp_rom_map_elem_t mp_module_builtins_globals_table[] = {
726726
{ MP_ROM_QSTR(MP_QSTR_round), MP_ROM_PTR(&mp_builtin_round_obj) },
727727
{ MP_ROM_QSTR(MP_QSTR_sorted), MP_ROM_PTR(&mp_builtin_sorted_obj) },
728728
{ MP_ROM_QSTR(MP_QSTR_sum), MP_ROM_PTR(&mp_builtin_sum_obj) },
729-
#if MICROPY_PY_TSTRINGS
730-
{ MP_ROM_QSTR(MP_QSTR___template__), MP_ROM_PTR(&mp_builtin___template___obj) },
731-
#endif
732729

733730
// built-in exceptions
734731
{ MP_ROM_QSTR(MP_QSTR_BaseException), MP_ROM_PTR(&mp_type_BaseException) },
@@ -766,6 +763,13 @@ static const mp_rom_map_elem_t mp_module_builtins_globals_table[] = {
766763
#endif
767764
{ MP_ROM_QSTR(MP_QSTR_ZeroDivisionError), MP_ROM_PTR(&mp_type_ZeroDivisionError) },
768765

766+
// Always include __template__ entry to maintain consistent table structure
767+
#if MICROPY_PY_TSTRINGS
768+
{ MP_ROM_QSTR(MP_QSTR___template__), MP_ROM_PTR(&mp_builtin___template___obj) },
769+
#else
770+
{ MP_ROM_QSTR(MP_QSTR___template__), MP_ROM_PTR(mp_const_none) },
771+
#endif
772+
769773
// Extra builtins as defined by a port
770774
MICROPY_PORT_BUILTINS
771775
MICROPY_PORT_EXTRA_BUILTINS

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy