mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 07:17:54 +08:00
a197a67142
After a turn the run_cancellable SIGINT handler is removed, so a Ctrl+C landing between turns (echoing user text, expire_yolo_once, gaps between statements, or re-entering _echo_interrupted) raised KeyboardInterrupt at an arbitrary bytecode and escaped run_repl, killing the whole REPL. Wrap the loop body in one try/except KeyboardInterrupt that re-prompts, and make _echo_interrupted itself suppress a further interrupt.