mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
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:
1 parent
80d3e52f32
commit
71dcb80df2
1 file changed
+2
-2
+2
-2
@@ -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(())
|
||||
}
|
||||
Reference in new issue
Block a user