From a4ff1a45b205171663559b0f7003ecf84face2aa Mon Sep 17 00:00:00 2001 From: kotfu Date: Sun, 10 Mar 2019 21:43:20 -0600 Subject: Allow both history indices to be negative --- cmd2/history.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cmd2/history.py') 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 -- cgit v1.2.1