summaryrefslogtreecommitdiff
path: root/python2/pyinotify.py
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2010-05-17 21:16:22 +0200
committerSebastien Martini <seb@dbzteam.org>2010-05-17 21:16:22 +0200
commite9751bfbaf9a514f76b52ee0290497675e6d67e3 (patch)
tree36b80d337c1682653179c5c433cd321f2828163d /python2/pyinotify.py
parent4ff4c0f2bb0092da4655f29fb76c5a74c0bf2071 (diff)
downloadpyinotify-e9751bfbaf9a514f76b52ee0290497675e6d67e3.tar.gz
Fixed previous fix f7510650b8e9950247d14841967eb64d0b2d0294.
Diffstat (limited to 'python2/pyinotify.py')
-rwxr-xr-xpython2/pyinotify.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py
index ababd1e..128ed5e 100755
--- a/python2/pyinotify.py
+++ b/python2/pyinotify.py
@@ -602,22 +602,24 @@ class _SysProcessEvent(_ProcessEvent):
addw = self._watch_manager.add_watch
# The newly monitored directory inherits attributes from its
# parent directory.
- newwd = addw(created_dir, watch_.mask, proc_fun=watch_.proc_fun,
- rec=False, auto_add=watch_.auto_add,
- exclude_filter=watch_.exclude_filter)
+ addw_ret = addw(created_dir, watch_.mask,
+ proc_fun=watch_.proc_fun,
+ rec=False, auto_add=watch_.auto_add,
+ exclude_filter=watch_.exclude_filter)
# Trick to handle mkdir -p /t1/t2/t3 where t1 is watched and
# t2 and t3 are created.
# Since the directory is new, then everything inside it
# must also be new.
- if newwd[created_dir] > 0:
+ created_dir_wd = addw_ret.get(created_dir)
+ if (created_dir_wd is not None) and created_dir_wd > 0:
for name in os.listdir(created_dir):
inner = os.path.join(created_dir, name)
if (os.path.isdir(inner) and
self._watch_manager.get_wd(inner) is None):
# Generate (simulate) creation event for sub
# directories.
- rawevent = _RawEvent(newwd[created_dir],
+ rawevent = _RawEvent(created_dir_wd,
IN_CREATE | IN_ISDIR,
0, name)
self._notifier.append_event(rawevent)