Skip to content

Commit 0c4597f

Browse files
authored
Move friendly REPL check to main function
1 parent 146e883 commit 0c4597f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
333333
// Collects stickiness bits that apply in the current situation.
334334
uint8_t next_code_stickiness_situation = SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET;
335335

336-
if (safe_mode == NO_SAFE_MODE && pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
336+
if (safe_mode == NO_SAFE_MODE) {
337337
static const char *const supported_filenames[] = STRING_LIST(
338338
"code.txt", "code.py", "main.py", "main.txt");
339339
#if CIRCUITPY_FULL_BUILD
@@ -858,7 +858,11 @@ int __attribute__((used)) main(void) {
858858
serial_write_compressed(translate("soft reboot\n"));
859859
}
860860
first_run = false;
861-
skip_repl = run_code_py(safe_mode);
861+
if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
862+
skip_repl = run_code_py(safe_mode);
863+
} else {
864+
skip_repl = false;
865+
}
862866
} else if (exit_code != 0) {
863867
break;
864868
}

0 commit comments

Comments
 (0)