Allow absent fromfd(), for Windows.

This commit is contained in:
Guido van Rossum 2002-06-12 20:48:59 +00:00
parent 733632ac1f
commit 6fb3d5ee92
1 changed files with 2 additions and 0 deletions

View File

@ -323,6 +323,8 @@ class BasicTCPTest(SocketConnectedTest):
def testFromFd(self):
"""Testing fromfd()."""
if not hasattr(socket, fromfd):
return # On Windows, this doesn't exist
fd = self.cli_conn.fileno()
sock = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
msg = sock.recv(1024)