From d9c84609344967bde3c9fa217f75fb1e7cff6fe0 Mon Sep 17 00:00:00 2001 From: jepler Date: Mon, 9 Sep 2019 20:03:54 -0500 Subject: 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('')` --- py/obj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/py/obj.c b/py/obj.c index 322a302f9..61345f3e2 100644 --- a/py/obj.c +++ b/py/obj.c @@ -63,6 +63,7 @@ const char *mp_obj_get_type_str(mp_const_obj_t o_in) { void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { // There can be data structures nested too deep, or just recursive MP_STACK_CHECK(); + RUN_BACKGROUND_TASKS; #ifndef NDEBUG if (o_in == MP_OBJ_NULL) { mp_print_str(print, "(nil)"); -- cgit v1.2.3