From: Ben Darnell Date: Thu, 20 Sep 2012 06:02:56 +0000 (-0700) Subject: Don't try to call set_wakeup_fd on windows, it crashes the process. X-Git-Tag: v3.0.0~272^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8a7ee408bc4d778e8fb1c47c036438be236f906;p=thirdparty%2Ftornado.git Don't try to call set_wakeup_fd on windows, it crashes the process. --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 6621f920e..c9af31b61 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -287,7 +287,9 @@ class IOLoop(object): # written to. As long as the wakeup fd is registered on the IOLoop, # the loop will still wake up and everything should work. old_wakeup_fd = None - if hasattr(signal, 'set_wakeup_fd'): # requires python 2.6+, unix + if hasattr(signal, 'set_wakeup_fd') and os.name == 'posix': + # requires python 2.6+, unix. set_wakeup_fd exists but crashes + # the python process on windows. try: old_wakeup_fd = signal.set_wakeup_fd(self._waker.write_fileno()) except ValueError: # non-main thread