summaryrefslogtreecommitdiff
path: root/ports/unix/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/input.c')
-rw-r--r--ports/unix/input.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ports/unix/input.c b/ports/unix/input.c
index 31926a5a8..260e9eac8 100644
--- a/ports/unix/input.c
+++ b/ports/unix/input.c
@@ -104,6 +104,9 @@ void prompt_write_history(void) {
#if MICROPY_USE_READLINE == 1
char *home = getenv("HOME");
if (home != NULL) {
+ if (MP_STATE_THREAD(gc_lock_depth) != 0) {
+ return;
+ }
vstr_t vstr;
vstr_init(&vstr, 50);
vstr_printf(&vstr, "%s/.micropython.history", home);