Skip to content

Commit 09eb6fe

Browse files
miss-islingtonberkerpeksag
authored andcommitted
bpo-32282: Remove unnecessary check for VersionHelpers.h in socketmodule.c on Windows (GH-5120)
(cherry picked from commit af11a15)
1 parent e6e440a commit 09eb6fe

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix an unnecessary ifdef in the include of VersionHelpers.h in socketmodule
2+
on Windows.

Modules/socketmodule.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,8 @@ if_indextoname(index) -- return the corresponding interface name\n\
312312
# include <fcntl.h>
313313
# endif
314314

315-
#if defined(_MSC_VER) && _MSC_VER >= 1800
316315
/* Provides the IsWindows7SP1OrGreater() function */
317316
#include <VersionHelpers.h>
318-
#endif
319317

320318
/* remove some flags on older version Windows during run-time.
321319
https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596.aspx */
@@ -6571,15 +6569,7 @@ PyInit__socket(void)
65716569

65726570
#ifdef MS_WINDOWS
65736571
if (support_wsa_no_inherit == -1) {
6574-
#if defined(_MSC_VER) && _MSC_VER >= 1800
65756572
support_wsa_no_inherit = IsWindows7SP1OrGreater();
6576-
#else
6577-
DWORD version = GetVersion();
6578-
DWORD major = (DWORD)LOBYTE(LOWORD(version));
6579-
DWORD minor = (DWORD)HIBYTE(LOWORD(version));
6580-
/* need Windows 7 SP1, 2008 R2 SP1 or later */
6581-
support_wsa_no_inherit = major > 6 || (major == 6 && minor >= 1);
6582-
#endif
65836573
}
65846574
#endif
65856575

0 commit comments

Comments
 (0)