summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLaurent Charignon <l.charignon@gmail.com>2016-01-31 17:56:51 -0800
committerLaurent Charignon <l.charignon@gmail.com>2016-01-31 17:57:01 -0800
commit21398657072bd91f05c2130f4d40085fc654e0f9 (patch)
tree5f0b7220ce4e657368186990c06ac3e7278bd550
parent79d929e201892811ed72d90cdb7935581d5daf9a (diff)
downloadranger-21398657072bd91f05c2130f4d40085fc654e0f9.tar.gz
history: fix maxlen is defined as an optional argument even if it is not one
We now throw an assert is someone forgets to specify maxlen
-rw-r--r--ranger/container/history.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/ranger/container/history.py b/ranger/container/history.py
index 8300edae..c1d929ed 100644
--- a/ranger/container/history.py
+++ b/ranger/container/history.py
@@ -8,6 +8,7 @@ class HistoryEmptyException(Exception):
 
 class History(object):
     def __init__(self, maxlen=None, unique=True):
+        assert maxlen is not None, "maxlen cannot be None"
         if isinstance(maxlen, History):
             self._history = list(maxlen._history)
             self._index = maxlen._index