Skip to content

Commit 2c30312

Browse files
committed
Fix waitskip behavior
1 parent cf9741b commit 2c30312

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
281281
result.exception_line = 0;
282282

283283
bool skip_repl;
284+
bool skip_wait = false;
284285
bool found_main = false;
285286
uint8_t next_code_options = 0;
286287
// Collects stickiness bits that apply in the current situation.
@@ -355,18 +356,23 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
355356
next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_SUCCESS;
356357
if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_SUCCESS) {
357358
skip_repl = true;
359+
skip_wait = true;
358360
//goto done;
359361
}
360362
}
361363
else {
362364
next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_ERROR;
363365
if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_ERROR) {
366+
// TODO: in what scenario is this acceptable
364367
skip_repl = true;
368+
skip_wait = true;
365369
//goto done;
366370
}
367371
}
368372
if (result.return_code & PYEXEC_FORCED_EXIT) {
373+
// TODO: what scenario does this describe?
369374
skip_repl = reload_requested;
375+
skip_wait = true;
370376
//goto done;
371377
}
372378

@@ -416,7 +422,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
416422
bool fake_sleeping = false;
417423
#endif
418424
// bool skip_repl = false;
419-
while (true) {
425+
while (!skip_wait) {
420426
RUN_BACKGROUND_TASKS;
421427

422428
// If a reload was requested by the supervisor or autoreload, return

0 commit comments

Comments
 (0)