From bfe60c2cff2352cbd32d682fadc460663ba77000 Mon Sep 17 00:00:00 2001 From: AndreiB97 Date: Sun, 18 Jul 2021 11:43:46 +0300 Subject: [PATCH] Fix SkipRepeatsQueue._put() raises AttributeError (#817) 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__() --- src/watchdog/utils/bricks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/watchdog/utils/bricks.py b/src/watchdog/utils/bricks.py index 35426b7cd..0a7e1cd32 100644 --- a/src/watchdog/utils/bricks.py +++ b/src/watchdog/utils/bricks.py @@ -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: