Skip to content

Commit 109ea4e

Browse files
committed
Keep REPL history-save errors from replacing exit status
Restore the two-line fix from #9078 onto main after it was merged into the Python 3.15 staging branch. Assisted-by: OpenAI Codex:model identifier unavailable
1 parent d88c935 commit 109ea4e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/shell.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ pub fn run_shell(vm: &VirtualMachine, scope: Scope) -> PyResult<()> {
217217

218218
if let Err(exc) = result {
219219
if exc.fast_isinstance(vm.ctx.exceptions.system_exit) {
220-
repl.save_history(&repl_history_path).unwrap();
220+
let _ = repl.save_history(&repl_history_path);
221221
return Err(exc);
222222
}
223223
vm.print_exception(&exc);
224224
}
225225
flush_stdio(vm);
226226
}
227-
repl.save_history(&repl_history_path).unwrap();
227+
let _ = repl.save_history(&repl_history_path);
228228

229229
Ok(())
230230
}

0 commit comments

Comments
 (0)