Skip to content

Commit

Permalink
Remove request on IN_IGNORED event
Browse files Browse the repository at this point in the history
  • Loading branch information
marksteward committed Oct 9, 2018
1 parent a953108 commit 1270a61
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions aionotify/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ctypes
import struct

from . import aioutils
from . import aioutils, enums

Event = collections.namedtuple('Event', ['flags', 'cookie', 'name', 'alias'])

Expand Down Expand Up @@ -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,
)

0 comments on commit 1270a61

Please sign in to comment.