Commit 4fe1dadc authored by Jason Madden's avatar Jason Madden

Restore SocketType, fix test__all__.py

parent bdddf00d
......@@ -10,7 +10,7 @@ for key in _socketcommon.__dict__:
globals()[key] = getattr(_socketcommon, key)
__socket__ = _socketcommon.__socket__
__implements__ = _socketcommon._implements + ['SocketType']
__implements__ = _socketcommon._implements
__extensions__ = _socketcommon.__extensions__
__imports__ = _socketcommon.__imports__
__dns__ = _socketcommon.__dns__
......
......@@ -15,7 +15,7 @@ for key in _socketcommon.__dict__:
__socket__ = _socketcommon.__socket__
__implements__ = _socketcommon._implements
__extensions__ = _socketcommon.__extensions__
__imports__ = _socketcommon.__imports__ + ['SocketType']
__imports__ = _socketcommon.__imports__
__dns__ = _socketcommon.__dns__
......@@ -65,6 +65,7 @@ class socket(object):
# Only defined under Linux
@property
def type(self):
# See https://github.com/gevent/gevent/pull/399
if self.timeout != 0.0:
return self._sock.type & ~_socket.SOCK_NONBLOCK
else:
......@@ -379,6 +380,9 @@ class socket(object):
self._sock.shutdown(how)
SocketType = socket
def fromfd(fd, family, type, proto=0):
""" fromfd(fd, family, type[, proto]) -> socket object
......
......@@ -4,6 +4,7 @@ from __future__ import absolute_import
# standard functions and classes that this module re-implements in a gevent-aware way:
_implements = ['create_connection',
'socket',
'SocketType',
'fromfd',
'socketpair']
......
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