]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/windows/inotify.py
don't do callbacks if we don't have any
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / windows / inotify.py
index 4e7bc90492c9a263f5e9008cb0813816e762db96..71d0f34e6e11e3e3a7109bec5a9bfadbe382735a 100644 (file)
@@ -272,11 +272,12 @@ class INotify(PollMixin):
                             self._pending.add(path)
                             def _do_callbacks():
                                 self._pending.remove(path)
-                                for cb in self._callbacks:
-                                    try:
-                                        cb(None, path, IN_CHANGED)
-                                    except Exception, e:
-                                        log.err(e)
+                                if self._callbacks:
+                                    for cb in self._callbacks:
+                                        try:
+                                            cb(None, path, IN_CHANGED)
+                                        except Exception, e:
+                                            log.err(e)
                             reactor.callLater(self._pending_delay, _do_callbacks)
                     reactor.callFromThread(_maybe_notify, path)
         except Exception, e: