summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjepler <jepler@gmail.com>2019-09-09 20:03:54 -0500
committerjepler <jepler@gmail.com>2019-09-09 20:14:02 -0500
commitd9c84609344967bde3c9fa217f75fb1e7cff6fe0 (patch)
treea69a1281ace2f2b73f30af60cf49308706a80b3b
parentbd7b03fc7ec1ca4f255e45e680d9fd053ad8ff4f (diff)
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('')`
-rw-r--r--py/obj.c1
1 files changed, 1 insertions, 0 deletions
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)");