mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-102336: Remove code specifically for handling Windows 7 (GH-102337)
This commit is contained in:
parent
360ef843d8
commit
938e36f824
7 changed files with 56 additions and 159 deletions
|
@ -1362,17 +1362,11 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works)
|
|||
else
|
||||
flags = 0;
|
||||
|
||||
/* This check can be removed once support for Windows 7 ends. */
|
||||
#define CONSOLE_PSEUDOHANDLE(handle) (((ULONG_PTR)(handle) & 0x3) == 0x3 && \
|
||||
GetFileType(handle) == FILE_TYPE_CHAR)
|
||||
|
||||
if (!CONSOLE_PSEUDOHANDLE(handle) &&
|
||||
!SetHandleInformation(handle, HANDLE_FLAG_INHERIT, flags)) {
|
||||
if (!SetHandleInformation(handle, HANDLE_FLAG_INHERIT, flags)) {
|
||||
if (raise)
|
||||
PyErr_SetFromWindowsErr(0);
|
||||
return -1;
|
||||
}
|
||||
#undef CONSOLE_PSEUDOHANDLE
|
||||
return 0;
|
||||
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue