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
This commit is contained in:
youknowdot authored and GitHub committed 2026-10-11 12:28:58 +09:00
1 parent 80d3e52f32
commit 71dcb80df2
1 file changed
+2 -2
+2 -2
View File
@@ -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(())
}