summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2010-09-09 10:19:32 +0200
committerSebastien Martini <seb@dbzteam.org>2010-09-09 10:26:18 +0200
commit91e8a9ca4348576220e8268ecb8b3492b2e9c022 (patch)
tree4ec66af49b88c519aab58d8fade27a382448eef8
parent6d552d2cc8ab42e0bfee58a650d85007cad01525 (diff)
downloadpyinotify-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-xpython2/pyinotify.py3
-rwxr-xr-xpython3/pyinotify.py3
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_