diff options
author | kotfu <kotfu@kotfu.net> | 2019-03-10 21:43:20 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2019-03-10 21:43:20 -0600 |
commit | a4ff1a45b205171663559b0f7003ecf84face2aa (patch) | |
tree | e078cbba60ff46563b7a92965ab81bb21ca52310 /cmd2/history.py | |
parent | 0ff0dfe37b7a9e6998a133452d4718a119b82cf7 (diff) | |
download | cmd2-git-a4ff1a45b205171663559b0f7003ecf84face2aa.tar.gz |
Allow both history indices to be negative
Diffstat (limited to 'cmd2/history.py')
-rw-r--r-- | cmd2/history.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cmd2/history.py b/cmd2/history.py index 819989b1..04baf014 100644 --- a/cmd2/history.py +++ b/cmd2/history.py @@ -167,9 +167,7 @@ class History(list): end = int(end) if start is not None and end is not None: - # we have both start and end, return a slice of history, unless both are negative - if start < 0 and end < 0: - raise ValueError + # we have both start and end, return a slice of history result = self[start:end] elif start is not None and sep is not None: # take a slice of the array |