Commit 658806bd authored by David Wilson's avatar David Wilson

fakessh: interruptible wait compatible with <2.7; closes #55

parent b3491b19
......@@ -160,8 +160,12 @@ class Process(object):
self.router.broker.start_receive(self.pump)
def wait(self):
while not self.wake_event.wait(0.1):
pass
while not self.wake_event.isSet():
# Timeout is used so that sleep is interruptible, as blocking
# variants of libc thread operations cannot be interrupted e.g. via
# KeyboardInterrupt. isSet() test and wait() are separate since in
# <2.7 wait() always returns None.
self.wake_event.wait(0.1):
@mitogen.core.takes_router
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment