Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6fb3d5e

Browse files
committed
Allow absent fromfd(), for Windows.
1 parent 733632a commit 6fb3d5e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/test/test_socket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ def _testSendAll(self):
323323

324324
def testFromFd(self):
325325
"""Testing fromfd()."""
326+
if not hasattr(socket, fromfd):
327+
return # On Windows, this doesn't exist
326328
fd = self.cli_conn.fileno()
327329
sock = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
328330
msg = sock.recv(1024)

0 commit comments

Comments
 (0)