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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add missing SetHandleInformation
  • Loading branch information
maxbachmann authored Feb 28, 2023
commit 3a2f4c123ba3a01b2d9d98ff212217be2bc4cb57
7 changes: 7 additions & 0 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5337,6 +5337,13 @@ sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
set_error();
return -1;
}

if (!SetHandleInformation((HANDLE)fd, HANDLE_FLAG_INHERIT, 0)) {
closesocket(fd);
PyErr_SetFromWindowsErr(0);
return -1;
}

family = info.iAddressFamily;
type = info.iSocketType;
proto = info.iProtocol;
Expand Down