Skip to content

Commit d9c8460

Browse files
committed
py/obj.c: This can be long-running, run background tasks
While finding sources of clicks and buzzes in nrf i2sout, I identified this site as one which could be long running. Reproducer code was to play a 22.05kHz sample and repeatedly print `os.listdir('')`
1 parent bd7b03f commit d9c8460

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

py/obj.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const char *mp_obj_get_type_str(mp_const_obj_t o_in) {
6363
void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) {
6464
// There can be data structures nested too deep, or just recursive
6565
MP_STACK_CHECK();
66+
RUN_BACKGROUND_TASKS;
6667
#ifndef NDEBUG
6768
if (o_in == MP_OBJ_NULL) {
6869
mp_print_str(print, "(nil)");

0 commit comments

Comments
 (0)