diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-06-04 20:05:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-04 20:05:47 -0400 |
commit | eb3d29538e3f898cb69e1f2964a7f84a3c0391d4 (patch) | |
tree | e6b78c86c518cea7892a8e165b938ad9aa7f049e /cmd2.py | |
parent | ccef0b4193297c0b88e8add373f6a49126ffe772 (diff) | |
parent | 3fa8f11a579d89104e845da4f315c5f293d8cfde (diff) | |
download | cmd2-git-eb3d29538e3f898cb69e1f2964a7f84a3c0391d4.tar.gz |
Merge pull request #117 from python-cmd2/history_exception
Bug fix for history exception
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1610,8 +1610,11 @@ class Cmd(cmd.Cmd): if arg: # If a character indicating a slice is present, retrieve a slice of the history if '..' in arg or ':' in arg: - # Get a slice of history - history = self.history.span(arg) + try: + # Get a slice of history + history = self.history.span(arg) + except IndexError: + history = self.history.get(arg) else: # Get item(s) from history by index or string search history = self.history.get(arg) |