Skip to content

Commit

Permalink
Fix SkipRepeatsQueue._put() raises AttributeError (#817)
Browse files Browse the repository at this point in the history
This fixes an issue with SkipRepeatsQueue._put() which causes it to raise
an AttributeError on the first put. This is done by adding a check to test
if _last_item is set to None, which is the value set by __init__()
  • Loading branch information
AndreiB97 committed Jul 18, 2021
1 parent 1be65c0 commit bfe60c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/watchdog/utils/bricks.py
Expand Up @@ -87,7 +87,7 @@ def _init(self, maxsize):
self._last_item = None

def _put(self, item):
if item != self._last_item:
if self._last_item is None or item != self._last_item:
super()._put(item)
self._last_item = item
else:
Expand Down

0 comments on commit bfe60c2

Please sign in to comment.