Skip to content

Commit 4fe1f6f

Browse files
committed
Fixed bug on Windows when calling set_close_exec() on socket after creation (call failed due to invalid socket fd type).
1 parent 02645a2 commit 4fe1f6f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

msgpackrpc/address.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def socket(self, family=socket.AF_UNSPEC):
2828
socket.SOCK_STREAM, 0, socket.AI_PASSIVE)[0]
2929
af, socktype, proto, canonname, sockaddr = res
3030
sock = socket.socket(af, socktype, proto)
31-
set_close_exec(sock)
31+
set_close_exec(sock.fileno())
3232
sock.setblocking(0)
3333
if af == socket.AF_INET6:
3434
if hasattr(socket, "IPPROTO_IPV6"):

0 commit comments

Comments
 (0)