File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -473,9 +473,6 @@ STATIC bool __attribute__((noinline)) run_code_py(safe_mode_t safe_mode, bool *s
473473 usb_setup_with_vm ();
474474 #endif
475475
476- // Make sure we are in the root directory before looking at files.
477- common_hal_os_chdir ("/" );
478-
479476 // Check if a different run file has been allocated
480477 if (next_code_configuration != NULL ) {
481478 next_code_configuration -> options &= ~SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET ;
@@ -1112,6 +1109,10 @@ int __attribute__((used)) main(void) {
11121109 serial_write_compressed (MP_ERROR_TEXT ("soft reboot\n" ));
11131110 }
11141111 simulate_reset = false;
1112+
1113+ // Always return to root before trying to run files.
1114+ common_hal_os_chdir ("/" );
1115+
11151116 if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL ) {
11161117 // If code.py did a fake deep sleep, pretend that we
11171118 // are running code.py for the first time after a hard
You can’t perform that action at this time.
0 commit comments