diff options
author | Sebastien Martini <seb@dbzteam.org> | 2010-09-09 10:19:32 +0200 |
---|---|---|
committer | Sebastien Martini <seb@dbzteam.org> | 2010-09-09 10:26:18 +0200 |
commit | 91e8a9ca4348576220e8268ecb8b3492b2e9c022 (patch) | |
tree | 4ec66af49b88c519aab58d8fade27a382448eef8 | |
parent | 6d552d2cc8ab42e0bfee58a650d85007cad01525 (diff) | |
download | pyinotify-91e8a9ca4348576220e8268ecb8b3492b2e9c022.tar.gz |
Remove watch descriptor from WatchManager's dictionary when a watch
is successfully removed (bug reported by jdw@research.att.com).
-rwxr-xr-x | python2/pyinotify.py | 3 | ||||
-rwxr-xr-x | python3/pyinotify.py | 3 |
2 files changed, 6 insertions, 0 deletions
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_ |