Skip to content

Commit

Permalink
m1n1.shell: carry on if saving history fails
Browse files Browse the repository at this point in the history
This shouldn't crash the shell — it's enough to warn about it and
carry on.

Signed-off-by: Alyssa Ross <[email protected]>
  • Loading branch information
alyssais committed Oct 28, 2023
1 parent 9a277fa commit 8dbf535
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proxyclient/m1n1/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def init_history(self, histfile):

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()
Expand Down

0 comments on commit 8dbf535

Please sign in to comment.