diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-01-29 11:21:49 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-01-29 11:21:49 -0500 |
commit | 0e70f0621273dd5f98aa5fffc42a5cb56f97c760 (patch) | |
tree | e6ccbe7d55be0e464ee48ae6857e835eb7192411 /cmd2/cmd2.py | |
parent | 7f76e23221677376bc3676094b6136bb5a259c52 (diff) | |
download | cmd2-git-0e70f0621273dd5f98aa5fffc42a5cb56f97c760.tar.gz |
Printing error when OSError other than FileNotFoundError occurs when deleting persistent history file with history --clear command.
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index ab72f1a6..51670235 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3993,6 +3993,9 @@ class Cmd(cmd.Cmd): os.remove(self.persistent_history_file) except FileNotFoundError: pass + except OSError as ex: + self.pexcept("Error removing history file '{}': {}".format(self.persistent_history_file, ex)) + return if rl_type != RlType.NONE: readline.clear_history() |