get rid of more win32 special-casing

This commit is contained in:
meejah 2016-06-15 08:15:49 -07:00 committed by Brian Warner
parent 1ac6c9bdf6
commit 4e0a30ab91
2 changed files with 6 additions and 4 deletions

View File

@ -1436,7 +1436,7 @@ class RealTest(SingleMagicFolderTestMixin, unittest.TestCase):
# Actually, there's no way to know when the actual
# notification will occur, and anyway we're not waiting for
# them in any case...so we'll just fudge it and hope 100ms is enough.
delay = 1.1 if sys.platform == "win32" else 0.1
delay = 0.1 if sys.platform == "win32" else 0.1
return task.deferLater(reactor, delay, lambda: None)
@ -1454,7 +1454,7 @@ class RealTestAliceBob(MagicFolderAliceBobTestMixin, unittest.TestCase):
# Actually, there's no way to know when the actual
# notification will occur, and anyway we're not waiting for
# them in any case...so we'll just fudge it and hope 100ms is enough.
delay = 1.1 if sys.platform == "win32" else 0.1
delay = 0.1 if sys.platform == "win32" else 0.1
return task.deferLater(reactor, delay, lambda: None)

View File

@ -293,8 +293,10 @@ class INotify(PollMixin):
def _maybe_notify(path):
if path not in self._pending:
self._pending.add(path)
if self._pending_call is None and self._state not in [STOPPING, STOPPED]:
self._pending_call = reactor.callLater(self._pending_delay, _do_pending_calls)
if self._state not in [STOPPING, STOPPED]:
_do_pending_calls()
# if self._pending_call is None and self._state not in [STOPPING, STOPPED]:
# self._pending_call = reactor.callLater(self._pending_delay, _do_pending_calls)
reactor.callFromThread(_maybe_notify, path)
if self._check_stop():