summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-01-29 11:21:49 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-01-29 11:21:49 -0500
commit0e70f0621273dd5f98aa5fffc42a5cb56f97c760 (patch)
treee6ccbe7d55be0e464ee48ae6857e835eb7192411 /cmd2/cmd2.py
parent7f76e23221677376bc3676094b6136bb5a259c52 (diff)
downloadcmd2-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.py3
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()