Commit 635a2372 authored by Denis Bilenko's avatar Denis Bilenko

socket: do not provide socketpair/fromfd if they don't exists on this platform

parent 2cbbf4cb
......@@ -521,14 +521,18 @@ class socket(object):
SocketType = socket
if hasattr(_socket, 'socketpair'):
def socketpair(*args):
one, two = _socket.socketpair(*args)
return socket(_sock=one), socket(_sock=two)
else:
__all__.remove('socketpair')
def socketpair(*args):
one, two = _socket.socketpair(*args)
return socket(_sock=one), socket(_sock=two)
def fromfd(*args):
return socket(_sock=_socket.fromfd(*args))
if hasattr(_socket, 'fromfd'):
def fromfd(*args):
return socket(_sock=_socket.fromfd(*args))
else:
__all__.remove('fromfd')
def bind_and_listen(descriptor, address=('', 0), backlog=50, reuse_addr=True):
......
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