From 1270a616d728bbfc5d5f027f41898522e135b5d9 Mon Sep 17 00:00:00 2001 From: Mark Steward Date: Tue, 9 Oct 2018 20:33:55 +0100 Subject: [PATCH] Remove request on IN_IGNORED event --- aionotify/base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aionotify/base.py b/aionotify/base.py index 113f68d..6775996 100644 --- a/aionotify/base.py +++ b/aionotify/base.py @@ -7,7 +7,7 @@ import ctypes import struct -from . import aioutils +from . import aioutils, enums Event = collections.namedtuple('Event', ['flags', 'cookie', 'name', 'alias']) @@ -124,10 +124,16 @@ def get_event(self): # Event for a removed watch, skip it. continue + alias = self.aliases[wd] + if flags & enums.Flags.IGNORED: + del self.descriptors[alias] + del self.requests[alias] + del self.aliases[wd] + decoded_path = struct.unpack('%ds' % length, path)[0].rstrip(b'\x00').decode('utf-8') return Event( flags=flags, cookie=cookie, name=decoded_path, - alias=self.aliases[wd], + alias=alias, )