From 71dcb80df210cf860ab186eb43a99d140eda4927 Mon Sep 17 00:00:00 2001 From: youknowdot Date: Sat, 10 Oct 2026 20:28:58 -0700 Subject: [PATCH] Keep REPL history-save errors from replacing exit status [skip ci] (#9078) Treat history persistence as best effort on EOF and SystemExit. Assisted-by: OpenAI Codex:model identifier unavailable --- src/shell.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell.rs b/src/shell.rs index a899370ac..734969815 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -217,14 +217,14 @@ pub fn run_shell(vm: &VirtualMachine, scope: Scope) -> PyResult<()> { if let Err(exc) = result { if exc.fast_isinstance(vm.ctx.exceptions.system_exit) { - repl.save_history(&repl_history_path).unwrap(); + let _ = repl.save_history(&repl_history_path); return Err(exc); } vm.print_exception(&exc); } flush_stdio(vm); } - repl.save_history(&repl_history_path).unwrap(); + let _ = repl.save_history(&repl_history_path); Ok(()) }