Skip to content

Commit a1e2b0b

Browse files
authored
Merge pull request adafruit#10291 from tannewt/fix_thonny_after_cwd_change
Always set current working dir
2 parents fa9b974 + 100f131 commit a1e2b0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ static void start_mp(safe_mode_t safe_mode) {
203203
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_lib));
204204

205205
mp_obj_list_init((mp_obj_list_t *)mp_sys_argv, 0);
206+
207+
// Always return to root
208+
common_hal_os_chdir("/");
206209
}
207210

208211
static void stop_mp(void) {
@@ -457,8 +460,6 @@ static bool __attribute__((noinline)) run_code_py(safe_mode_t safe_mode, bool *s
457460
usb_setup_with_vm();
458461
#endif
459462

460-
// Always return to root before trying to run files.
461-
common_hal_os_chdir("/");
462463
// Check if a different run file has been allocated
463464
if (next_code_configuration != NULL) {
464465
next_code_configuration->options &= ~SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy