summaryrefslogtreecommitdiff
path: root/py/obj.c
diff options
context:
space:
mode:
authoraskpatricw <4002194+askpatrickw@users.noreply.github.com>2020-12-31 16:54:22 -0800
committeraskpatricw <4002194+askpatrickw@users.noreply.github.com>2020-12-31 16:54:22 -0800
commit9e559ac3ec199890d2ee99eb060743bab3083c46 (patch)
treecc5bf4c3d82a9feac6baa3e83c73e525f928f17f /py/obj.c
parentf814a34714cfa7d76464cf9a66a1586caa2b423d (diff)
parent5698b8bb0a178d9022cb20de417efa0f77216e87 (diff)
Merge branch 'main' of https://github.com/adafruit/circuitpython into main
Diffstat (limited to 'py/obj.c')
-rw-r--r--py/obj.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/py/obj.c b/py/obj.c
index b6462641c..5f19089e8 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -29,6 +29,7 @@
#include <stdarg.h>
#include <assert.h>
+#include "lib/utils/interrupt_char.h"
#include "py/obj.h"
#include "py/objtype.h"
#include "py/objint.h"
@@ -67,7 +68,12 @@ void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t
#ifdef RUN_BACKGROUND_TASKS
RUN_BACKGROUND_TASKS;
#endif
- mp_handle_pending();
+ #if MICROPY_KBD_EXCEPTION
+ // Stop printing if we've been interrupted.
+ if (mp_hal_is_interrupted()) {
+ return;
+ }
+ #endif
#ifndef NDEBUG
if (o_in == MP_OBJ_NULL) {