]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Don't try to call set_wakeup_fd on windows, it crashes the process.
authorBen Darnell <ben@bendarnell.com>
Thu, 20 Sep 2012 06:02:56 +0000 (23:02 -0700)
committerBen Darnell <ben@bendarnell.com>
Thu, 20 Sep 2012 06:02:56 +0000 (23:02 -0700)
tornado/ioloop.py

index 6621f920e0ce6f007d5dd6369bba027e9bf31f29..c9af31b6169fc8f16aba8d45475713033c3d3545 100644 (file)
@@ -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