From 91e8a9ca4348576220e8268ecb8b3492b2e9c022 Mon Sep 17 00:00:00 2001 From: Sebastien Martini Date: Thu, 9 Sep 2010 10:19:32 +0200 Subject: Remove watch descriptor from WatchManager's dictionary when a watch is successfully removed (bug reported by jdw@research.att.com). --- python2/pyinotify.py | 3 +++ python3/pyinotify.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/python2/pyinotify.py b/python2/pyinotify.py index 56ce8cb..e10aa83 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -1966,6 +1966,9 @@ class WatchManager: continue raise WatchManagerError(err, ret_) + # Remove watch from our dictionary + if awd in self._wmd: + del self._wmd[awd] ret_[awd] = True log.debug('Watch WD=%d (%s) removed', awd, self.get_path(awd)) return ret_ diff --git a/python3/pyinotify.py b/python3/pyinotify.py index 467a521..a2eda17 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -1922,6 +1922,9 @@ class WatchManager: continue raise WatchManagerError(err, ret_) + # Remove watch from our dictionary + if awd in self._wmd: + del self._wmd[awd] ret_[awd] = True log.debug('Watch WD=%d (%s) removed', awd, self.get_path(awd)) return ret_ -- cgit v1.2.1