##// END OF EJS Templates
selectors2: do not use platform.system()...
Jun Wu -
r34640:a568a467 default
parent child Browse files
Show More
@@ -314,3 +314,5 b' else:'
314 stringio = cStringIO.StringIO
314 stringio = cStringIO.StringIO
315 maplist = map
315 maplist = map
316 rawinput = raw_input
316 rawinput = raw_input
317
318 isjython = sysplatform.startswith('java')
@@ -29,12 +29,13 b' from __future__ import absolute_import'
29 import collections
29 import collections
30 import errno
30 import errno
31 import math
31 import math
32 import platform
33 import select
32 import select
34 import socket
33 import socket
35 import sys
34 import sys
36 import time
35 import time
37
36
37 from . import pycompat
38
38 namedtuple = collections.namedtuple
39 namedtuple = collections.namedtuple
39 Mapping = collections.Mapping
40 Mapping = collections.Mapping
40
41
@@ -288,7 +289,7 b' if hasattr(select, "select"):'
288 __all__.append('SelectSelector')
289 __all__.append('SelectSelector')
289
290
290 # Jython has a different implementation of .fileno() for socket objects.
291 # Jython has a different implementation of .fileno() for socket objects.
291 if platform.system() == 'Java':
292 if pycompat.isjython:
292 class _JythonSelectorMapping(object):
293 class _JythonSelectorMapping(object):
293 """ This is an implementation of _SelectorMapping that is built
294 """ This is an implementation of _SelectorMapping that is built
294 for use specifically with Jython, which does not provide a hashable
295 for use specifically with Jython, which does not provide a hashable
@@ -727,7 +728,7 b' def DefaultSelector():'
727 by eventlet, greenlet, and preserve proper behavior. """
728 by eventlet, greenlet, and preserve proper behavior. """
728 global _DEFAULT_SELECTOR
729 global _DEFAULT_SELECTOR
729 if _DEFAULT_SELECTOR is None:
730 if _DEFAULT_SELECTOR is None:
730 if platform.system() == 'Java': # Platform-specific: Jython
731 if pycompat.isjython:
731 _DEFAULT_SELECTOR = JythonSelectSelector
732 _DEFAULT_SELECTOR = JythonSelectSelector
732 elif _can_allocate('kqueue'):
733 elif _can_allocate('kqueue'):
733 _DEFAULT_SELECTOR = KqueueSelector
734 _DEFAULT_SELECTOR = KqueueSelector
General Comments 0
You need to be logged in to leave comments. Login now