From 09eb6fe8fdd2515546b933902aef36b72d417ace Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Fri, 18 May 2018 10:38:19 -0700 Subject: [PATCH] bpo-32282: Remove unnecessary check for `VersionHelpers.h` in `socketmodule.c` on Windows (GH-5120) (cherry picked from commit af11a15c586e980a157c04ee60b6e33dc7228f3f) --- .../2017-12-12-14-02-28.bpo-32282.xFVMTn.rst | 2 ++ Modules/socketmodule.c | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2017-12-12-14-02-28.bpo-32282.xFVMTn.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-12-12-14-02-28.bpo-32282.xFVMTn.rst b/Misc/NEWS.d/next/Core and Builtins/2017-12-12-14-02-28.bpo-32282.xFVMTn.rst new file mode 100644 index 000000000000..1c833c5439b1 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2017-12-12-14-02-28.bpo-32282.xFVMTn.rst @@ -0,0 +1,2 @@ +Fix an unnecessary ifdef in the include of VersionHelpers.h in socketmodule +on Windows. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 36920f7f8633..ff73a3fbfa2b 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -312,10 +312,8 @@ http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82& # include # endif -#if defined(_MSC_VER) && _MSC_VER >= 1800 /* Provides the IsWindows7SP1OrGreater() function */ #include -#endif /* remove some flags on older version Windows during run-time. https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596.aspx */ @@ -6571,15 +6569,7 @@ PyInit__socket(void) #ifdef MS_WINDOWS if (support_wsa_no_inherit == -1) { -#if defined(_MSC_VER) && _MSC_VER >= 1800 support_wsa_no_inherit = IsWindows7SP1OrGreater(); -#else - DWORD version = GetVersion(); - DWORD major = (DWORD)LOBYTE(LOWORD(version)); - DWORD minor = (DWORD)HIBYTE(LOWORD(version)); - /* need Windows 7 SP1, 2008 R2 SP1 or later */ - support_wsa_no_inherit = major > 6 || (major == 6 && minor >= 1); -#endif } #endif -- 2.47.3