Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed Mar 26, 2016
1 parent b4e9cec commit f7dd0dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions depq/depq.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,10 @@ def maxlen(self):
@maxlen.setter
def maxlen(self, length):
"""Sets maxlen"""
self._maxlen = length
while len(self.data) > length:
self.poplast()
with self.lock:
self._maxlen = length
while len(self.data) > length:
self._poplast()

def count(self, item):
"""Returns number of occurrences of item in DEPQ. Performance: O(1)"""
Expand Down

0 comments on commit f7dd0dc

Please sign in to comment.