summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2010-04-04 23:25:23 +0200
committerSebastien Martini <seb@dbzteam.org>2010-04-04 23:25:23 +0200
commita6f14ef16de967cb342057549467feb5a47252ab (patch)
tree955b968970b68d66211cdfeecd25d63cbe9869bd
parentc3cb39c167234e651ef20b1647161a073c2b9454 (diff)
downloadpyinotify-a6f14ef16de967cb342057549467feb5a47252ab.tar.gz
Fixed dictionary item deletion on iteration (submitted by knurxs@gmx.de).
-rwxr-xr-xpython3/pyinotify.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python3/pyinotify.py b/python3/pyinotify.py
index 27fa0fb..4f8fd11 100755
--- a/python3/pyinotify.py
+++ b/python3/pyinotify.py
@@ -546,8 +546,8 @@ class _SysProcessEvent(_ProcessEvent):
and self._mv.
"""
date_cur_ = datetime.now()
- for seq in [self._mv_cookie, self._mv]:
- for k in seq.keys():
+ for seq in (self._mv_cookie, self._mv):
+ for k in list(seq.keys()):
if (date_cur_ - seq[k][1]) > timedelta(minutes=1):
log.debug('Cleanup: deleting entry %s', seq[k][0])
del seq[k]