mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 01:34:12 +00:00
m1n1.shell: carry on if saving history fails
This shouldn't crash the shell — it's enough to warn about it and carry on. Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
parent
9a277fadc9
commit
0d5454e235
1 changed files with 4 additions and 1 deletions
|
@ -30,7 +30,10 @@ class HistoryConsole(code.InteractiveConsole):
|
|||
|
||||
def save_history(self):
|
||||
readline.set_history_length(10000)
|
||||
readline.write_history_file(self.histfile)
|
||||
try:
|
||||
readline.write_history_file(self.histfile)
|
||||
except OSError as e:
|
||||
print(f"Failed writing history to {self.histfile}: {e}", file=sys.stderr)
|
||||
|
||||
def showtraceback(self):
|
||||
type, value, tb = sys.exc_info()
|
||||
|
|
Loading…
Reference in a new issue