File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -105,12 +105,16 @@ void mp_run(void) {
105
105
readline_init0 ();
106
106
microbit_init ();
107
107
108
- if (APPENDED_SCRIPT -> header [0 ] == 'M' && APPENDED_SCRIPT -> header [1 ] == 'P' ) {
109
- // run appended script
110
- do_strn (APPENDED_SCRIPT -> str , APPENDED_SCRIPT -> len );
111
- } else if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL ) {
112
- // from microbit import *
113
- mp_import_all (mp_import_name (MP_QSTR_microbit , mp_const_empty_tuple , MP_OBJ_NEW_SMALL_INT (0 )));
108
+ // Only run initial script (or import from microbit) if we are in "friendly REPL"
109
+ // mode. If we are in "raw REPL" mode then this will be skipped.
110
+ if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL ) {
111
+ if (APPENDED_SCRIPT -> header [0 ] == 'M' && APPENDED_SCRIPT -> header [1 ] == 'P' ) {
112
+ // run appended script
113
+ do_strn (APPENDED_SCRIPT -> str , APPENDED_SCRIPT -> len );
114
+ } else {
115
+ // from microbit import *
116
+ mp_import_all (mp_import_name (MP_QSTR_microbit , mp_const_empty_tuple , MP_OBJ_NEW_SMALL_INT (0 )));
117
+ }
114
118
}
115
119
116
120
for (;;) {
You can’t perform that action at this time.
0 commit comments