uses of os.name == 'posix' and sys.platform.startswith('win')
import cgi
import errno
-try:
- import fcntl
-except ImportError:
- import sys
- if sys.platform.startswith("win"):
- import win32_support as fcntl
- else:
- raise
import functools
import ioloop
import iostream
import time
import urlparse
+try:
+ import fcntl
+except ImportError:
+ if os.name == 'nt':
+ import win32_support as fcntl
+ else:
+ raise
+
try:
import ssl # Python 2.6+
except ImportError:
import bisect
import errno
import os
+import logging
+import select
+import time
+
try:
import fcntl
except ImportError:
- if os.name != 'posix':
+ if os.name == 'nt':
import win32_support
import win32_support as fcntl
else:
raise
-import logging
-import select
-import time
-
_log = logging.getLogger("tornado.ioloop")
# Create a pipe that we send bogus data to when we want to wake
# the I/O loop when it is idle
- if os.name == 'posix':
+ if os.name != 'nt':
r, w = os.pipe()
self._set_nonblocking(r)
self._set_nonblocking(w)