Commit f6f59675 authored by Jason Madden's avatar Jason Madden

Version simplifications.

parent 0ccd42ca
......@@ -628,24 +628,7 @@ class socket(object):
del _added
if sys.version_info[:2] == (3, 4) and sys.version_info[:3] <= (3, 4, 2):
# Python 3.4, up to and including 3.4.2, had a bug where the
# SocketType enumeration overwrote the SocketType class imported
# from _socket. This was fixed in 3.4.3 (http://bugs.python.org/issue20386
# and https://github.com/python/cpython/commit/0d2f85f38a9691efdfd1e7285c4262cab7f17db7).
# Prior to that, if we replace SocketType with our own class, the implementation
# of socket.type breaks with "OSError: [Errno 97] Address family not supported by protocol".
# Therefore, on these old versions, we must preserve it as an enum; while this
# seems like it could lead to non-green behaviour, code on those versions
# cannot possibly be using SocketType as a class anyway.
SocketType = __socket__.SocketType # pylint:disable=no-member
# Fixup __all__; note that we get exec'd multiple times during unit tests
if 'SocketType' in __implements__:
__implements__.remove('SocketType')
if 'SocketType' not in __imports__:
__imports__.append('SocketType')
else:
SocketType = socket
SocketType = socket
def fromfd(fd, family, type, proto=0):
......
......@@ -827,7 +827,7 @@ def patch_select(aggressive=True):
remove_item(select, 'kevent')
remove_item(select, 'devpoll')
if sys.version_info[:2] >= (3, 4):
if PY3:
# Python 3 wants to use `select.select` as a member function,
# leading to this error in selectors.py (because gevent.select.select is
# not a builtin and doesn't get the magic auto-static that they do)
......
......@@ -314,7 +314,7 @@ if PY3:
if sys.version_info[:2] >= (3, 4) and APPVEYOR:
if PY3 and APPVEYOR:
FAILING_TESTS += [
# Timing issues on appveyor
'FLAKY test_selectors.py'
......
......@@ -8,7 +8,7 @@ except ImportError:
from gevent.monkey import patch_all
patch_all()
if sys.platform != 'win32' and sys.version_info[:2] >= (3, 4):
if sys.platform != 'win32' and greentest.PY3:
class TestSelectors(greentest.TestCase):
......
......@@ -44,7 +44,7 @@ class Test(greentest.TestCase):
# We generated some warnings
if sys.version_info >= (3, 4):
if greentest.PY3:
self.assertEqual(all_warnings,
['Monkey-patching outside the main native thread. Some APIs will not be '
'available. Expect a KeyError to be printed at shutdown.',
......
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