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('')`
This commit is contained in:
jepler 2019-09-09 20:03:54 -05:00
parent bd7b03fc7e
commit d9c8460934
1 changed files with 1 additions and 0 deletions

View File

@ -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)");