summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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_