From 1a83cedfdf2e84ea85636ff192d420f4de7da7a1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 18 Jan 2018 10:37:26 +0100 Subject: [PATCH 1/4] bpo-32592: Drop support for Windows Vista Windows Vista extended support ended in April 2017. As stated in PEP 11, Python 3.7 drops support for Windows Vista and now requires Windows 7 or newer. --- Doc/library/time.rst | 8 ---- Doc/using/windows.rst | 3 +- Include/internal/condvar.h | 47 +------------------ .../2018-01-18-10-39-37.bpo-32592.EPqtd6.rst | 3 ++ Modules/posixmodule.c | 17 +------ PC/pyconfig.h | 4 +- PC/pyshellext.cpp | 6 +-- PCbuild/readme.txt | 2 +- 8 files changed, 13 insertions(+), 77 deletions(-) create mode 100644 Misc/NEWS.d/next/Windows/2018-01-18-10-39-37.bpo-32592.EPqtd6.rst diff --git a/Doc/library/time.rst b/Doc/library/time.rst index ccbb3f37877b2c..612af749c3ecaf 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -293,14 +293,6 @@ Functions The reference point of the returned value is undefined, so that only the difference between the results of consecutive calls is valid. - On Windows versions older than Vista, :func:`monotonic` detects - :c:func:`GetTickCount` integer overflow (32 bits, roll-over after 49.7 days). - It increases an internal epoch (reference time) by 2\ :sup:`32` each time - that an overflow is detected. The epoch is stored in the process-local state - and so the value of :func:`monotonic` may be different in two Python - processes running for more than 49 days. On more recent versions of Windows - and on other operating systems, :func:`monotonic` is system-wide. - .. versionadded:: 3.3 .. versionchanged:: 3.5 The function is now always available. diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst index cc560d968a1de9..cb6c43522a5147 100644 --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -29,7 +29,8 @@ Supported Versions As specified in :pep:`11`, a Python release only supports a Windows platform while Microsoft considers the platform under extended support. This means that -Python |version| supports Windows Vista and newer. If you require Windows XP +Python |version| supports Windows 7 and newer. If you require Windows Vista +support then please install Python 3.6. If you require Windows XP support then please install Python 3.4. Installation Steps diff --git a/Include/internal/condvar.h b/Include/internal/condvar.h index f9330890d3e645..2405bd4e83af4f 100644 --- a/Include/internal/condvar.h +++ b/Include/internal/condvar.h @@ -34,58 +34,13 @@ #define WIN32_LEAN_AND_MEAN #include -/* options */ -/* non-emulated condition variables are provided for those that want - * to target Windows Vista. Modify this macro to enable them. - */ -#ifndef _PY_EMULATED_WIN_CV -#define _PY_EMULATED_WIN_CV 1 /* use emulated condition variables */ -#endif - -/* fall back to emulation if not targeting Vista */ -#if !defined NTDDI_VISTA || NTDDI_VERSION < NTDDI_VISTA -#undef _PY_EMULATED_WIN_CV -#define _PY_EMULATED_WIN_CV 1 -#endif - -#if _PY_EMULATED_WIN_CV - -typedef CRITICAL_SECTION PyMUTEX_T; - -/* The ConditionVariable object. From XP onwards it is easily emulated - with a Semaphore. - Semaphores are available on Windows XP (2003 server) and later. - We use a Semaphore rather than an auto-reset event, because although - an auto-resent event might appear to solve the lost-wakeup bug (race - condition between releasing the outer lock and waiting) because it - maintains state even though a wait hasn't happened, there is still - a lost wakeup problem if more than one thread are interrupted in the - critical place. A semaphore solves that, because its state is - counted, not Boolean. - Because it is ok to signal a condition variable with no one - waiting, we need to keep track of the number of - waiting threads. Otherwise, the semaphore's state could rise - without bound. This also helps reduce the number of "spurious wakeups" - that would otherwise happen. - */ - -typedef struct _PyCOND_T -{ - HANDLE sem; - int waiting; /* to allow PyCOND_SIGNAL to be a no-op */ -} PyCOND_T; - -#else /* !_PY_EMULATED_WIN_CV */ - -/* Use native Win7 primitives if build target is Win7 or higher */ +/* Use native Win7 primitives */ /* SRWLOCK is faster and better than CriticalSection */ typedef SRWLOCK PyMUTEX_T; typedef CONDITION_VARIABLE PyCOND_T; -#endif /* _PY_EMULATED_WIN_CV */ - #endif /* _POSIX_THREADS, NT_THREADS */ #endif /* Py_INTERNAL_CONDVAR_H */ diff --git a/Misc/NEWS.d/next/Windows/2018-01-18-10-39-37.bpo-32592.EPqtd6.rst b/Misc/NEWS.d/next/Windows/2018-01-18-10-39-37.bpo-32592.EPqtd6.rst new file mode 100644 index 00000000000000..5b4890890eb27b --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-01-18-10-39-37.bpo-32592.EPqtd6.rst @@ -0,0 +1,3 @@ +Drop support for Windows Vista. Windows Vista extended support ended in +April 2017. As stated in :pep:`11`, Python 3.7 drops support for Windows +Vista and now requires Windows 7 or newer. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index b0e48dabbd55cf..52ed76ae697a60 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -11153,22 +11153,7 @@ os_cpu_count_impl(PyObject *module) { int ncpu = 0; #ifdef MS_WINDOWS - /* Vista is supported and the GetMaximumProcessorCount API is Win7+ - Need to fallback to Vista behavior if this call isn't present */ - HINSTANCE hKernel32; - hKernel32 = GetModuleHandleW(L"KERNEL32"); - - static DWORD(CALLBACK *_GetMaximumProcessorCount)(WORD) = NULL; - *(FARPROC*)&_GetMaximumProcessorCount = GetProcAddress(hKernel32, - "GetMaximumProcessorCount"); - if (_GetMaximumProcessorCount != NULL) { - ncpu = _GetMaximumProcessorCount(ALL_PROCESSOR_GROUPS); - } - else { - SYSTEM_INFO sysinfo; - GetSystemInfo(&sysinfo); - ncpu = sysinfo.dwNumberOfProcessors; - } + ncpu = GetMaximumProcessorCount(ALL_PROCESSOR_GROUPS); #elif defined(__hpux) ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL); #elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index db745dee761777..4aa5ff469c1122 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -132,8 +132,8 @@ WIN32 is still required for the locale module. #endif /* MS_WIN64 */ /* set the version macros for the windows headers */ -/* Python 3.5+ requires Windows Vista or greater */ -#define Py_WINVER 0x0600 /* _WIN32_WINNT_VISTA */ +/* Python 3.7+ requires Windows 7 or greater */ +#define Py_WINVER 0x0601 /* _WIN32_WINNT_WIN7 */ #define Py_NTDDI NTDDI_VISTA /* We only set these values when building Python - we don't want to force diff --git a/PC/pyshellext.cpp b/PC/pyshellext.cpp index 04fe61e89618bd..18c6c27a22e564 100644 --- a/PC/pyshellext.cpp +++ b/PC/pyshellext.cpp @@ -1,5 +1,5 @@ -// Support back to Vista -#define _WIN32_WINNT _WIN32_WINNT_VISTA +// Support back to Windows 7 +#define _WIN32_WINNT _WIN32_WINNT_WIN7 #include // Use WRL to define a classic COM class @@ -602,4 +602,4 @@ STDAPI_(BOOL) DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*) { DisableThreadLibraryCalls(hinst); } return TRUE; -} \ No newline at end of file +} diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index d28435b4c4d7d9..3a26116429f140 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -14,7 +14,7 @@ Building Python using Microsoft Visual C++ ------------------------------------------ This directory is used to build CPython for Microsoft Windows NT version -6.0 or higher (Windows Vista, Windows Server 2008, or later) on 32 and 64 +6.1 or higher (Windows 7 or later) on 32 and 64 bit platforms. Using this directory requires an installation of Microsoft Visual Studio 2017 (MSVC 14.1) with the *Python workload* and its optional *Python native development* component selected. (For From 7dc2b5dc2d932627d59f341355f55bd1d37dd870 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 18 Jan 2018 11:23:28 +0100 Subject: [PATCH 2/4] Remove condvar emulation (_PY_EMULATED_WIN_CV) Rephrase also a comment in condvar.h. --- Include/internal/condvar.h | 9 +-- Python/condvar.h | 153 ------------------------------------- 2 files changed, 1 insertion(+), 161 deletions(-) diff --git a/Include/internal/condvar.h b/Include/internal/condvar.h index 2405bd4e83af4f..2145ccee988282 100644 --- a/Include/internal/condvar.h +++ b/Include/internal/condvar.h @@ -22,20 +22,13 @@ #define PyCOND_T pthread_cond_t #elif defined(NT_THREADS) -/* - * Windows (XP, 2003 server and later, as well as (hopefully) CE) support - * - * Emulated condition variables ones that work with XP and later, plus - * example native support on VISTA and onwards. - */ +/* Windows support: use native Win7 primitives */ #define Py_HAVE_CONDVAR /* include windows if it hasn't been done before */ #define WIN32_LEAN_AND_MEAN #include -/* Use native Win7 primitives */ - /* SRWLOCK is faster and better than CriticalSection */ typedef SRWLOCK PyMUTEX_T; diff --git a/Python/condvar.h b/Python/condvar.h index 951b8ad47f07be..a983913dc737e5 100644 --- a/Python/condvar.h +++ b/Python/condvar.h @@ -97,156 +97,6 @@ PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, long long us) } #elif defined(NT_THREADS) -/* - * Windows (XP, 2003 server and later, as well as (hopefully) CE) support - * - * Emulated condition variables ones that work with XP and later, plus - * example native support on VISTA and onwards. - */ - -#if _PY_EMULATED_WIN_CV - -/* The mutex is a CriticalSection object and - The condition variables is emulated with the help of a semaphore. - - This implementation still has the problem that the threads woken - with a "signal" aren't necessarily those that are already - waiting. It corresponds to listing 2 in: - http://birrell.org/andrew/papers/ImplementingCVs.pdf - - Generic emulations of the pthread_cond_* API using - earlier Win32 functions can be found on the Web. - The following read can be give background information to these issues, - but the implementations are all broken in some way. - http://www.cse.wustl.edu/~schmidt/win32-cv-1.html -*/ - -Py_LOCAL_INLINE(int) -PyMUTEX_INIT(PyMUTEX_T *cs) -{ - InitializeCriticalSection(cs); - return 0; -} - -Py_LOCAL_INLINE(int) -PyMUTEX_FINI(PyMUTEX_T *cs) -{ - DeleteCriticalSection(cs); - return 0; -} - -Py_LOCAL_INLINE(int) -PyMUTEX_LOCK(PyMUTEX_T *cs) -{ - EnterCriticalSection(cs); - return 0; -} - -Py_LOCAL_INLINE(int) -PyMUTEX_UNLOCK(PyMUTEX_T *cs) -{ - LeaveCriticalSection(cs); - return 0; -} - - -Py_LOCAL_INLINE(int) -PyCOND_INIT(PyCOND_T *cv) -{ - /* A semaphore with a "large" max value, The positive value - * is only needed to catch those "lost wakeup" events and - * race conditions when a timed wait elapses. - */ - cv->sem = CreateSemaphore(NULL, 0, 100000, NULL); - if (cv->sem==NULL) - return -1; - cv->waiting = 0; - return 0; -} - -Py_LOCAL_INLINE(int) -PyCOND_FINI(PyCOND_T *cv) -{ - return CloseHandle(cv->sem) ? 0 : -1; -} - -/* this implementation can detect a timeout. Returns 1 on timeout, - * 0 otherwise (and -1 on error) - */ -Py_LOCAL_INLINE(int) -_PyCOND_WAIT_MS(PyCOND_T *cv, PyMUTEX_T *cs, DWORD ms) -{ - DWORD wait; - cv->waiting++; - PyMUTEX_UNLOCK(cs); - /* "lost wakeup bug" would occur if the caller were interrupted here, - * but we are safe because we are using a semaphore which has an internal - * count. - */ - wait = WaitForSingleObjectEx(cv->sem, ms, FALSE); - PyMUTEX_LOCK(cs); - if (wait != WAIT_OBJECT_0) - --cv->waiting; - /* Here we have a benign race condition with PyCOND_SIGNAL. - * When failure occurs or timeout, it is possible that - * PyCOND_SIGNAL also decrements this value - * and signals releases the mutex. This is benign because it - * just means an extra spurious wakeup for a waiting thread. - * ('waiting' corresponds to the semaphore's "negative" count and - * we may end up with e.g. (waiting == -1 && sem.count == 1). When - * a new thread comes along, it will pass right throuhgh, having - * adjusted it to (waiting == 0 && sem.count == 0). - */ - - if (wait == WAIT_FAILED) - return -1; - /* return 0 on success, 1 on timeout */ - return wait != WAIT_OBJECT_0; -} - -Py_LOCAL_INLINE(int) -PyCOND_WAIT(PyCOND_T *cv, PyMUTEX_T *cs) -{ - int result = _PyCOND_WAIT_MS(cv, cs, INFINITE); - return result >= 0 ? 0 : result; -} - -Py_LOCAL_INLINE(int) -PyCOND_TIMEDWAIT(PyCOND_T *cv, PyMUTEX_T *cs, long long us) -{ - return _PyCOND_WAIT_MS(cv, cs, (DWORD)(us/1000)); -} - -Py_LOCAL_INLINE(int) -PyCOND_SIGNAL(PyCOND_T *cv) -{ - /* this test allows PyCOND_SIGNAL to be a no-op unless required - * to wake someone up, thus preventing an unbounded increase of - * the semaphore's internal counter. - */ - if (cv->waiting > 0) { - /* notifying thread decreases the cv->waiting count so that - * a delay between notify and actual wakeup of the target thread - * doesn't cause a number of extra ReleaseSemaphore calls. - */ - cv->waiting--; - return ReleaseSemaphore(cv->sem, 1, NULL) ? 0 : -1; - } - return 0; -} - -Py_LOCAL_INLINE(int) -PyCOND_BROADCAST(PyCOND_T *cv) -{ - int waiting = cv->waiting; - if (waiting > 0) { - cv->waiting = 0; - return ReleaseSemaphore(cv->sem, waiting, NULL) ? 0 : -1; - } - return 0; -} - -#else /* !_PY_EMULATED_WIN_CV */ Py_LOCAL_INLINE(int) PyMUTEX_INIT(PyMUTEX_T *cs) @@ -317,9 +167,6 @@ PyCOND_BROADCAST(PyCOND_T *cv) return 0; } - -#endif /* _PY_EMULATED_WIN_CV */ - #endif /* _POSIX_THREADS, NT_THREADS */ #endif /* _CONDVAR_IMPL_H_ */ From 764f4a89c39ef1290b647a5163a78aa47923b237 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 18 Jan 2018 15:19:14 +0100 Subject: [PATCH 3/4] Revert: keep _PY_EMULATED_WIN_CV --- Include/internal/condvar.h | 54 ++++++++++++- Python/condvar.h | 153 +++++++++++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+), 1 deletion(-) diff --git a/Include/internal/condvar.h b/Include/internal/condvar.h index 2145ccee988282..f9330890d3e645 100644 --- a/Include/internal/condvar.h +++ b/Include/internal/condvar.h @@ -22,18 +22,70 @@ #define PyCOND_T pthread_cond_t #elif defined(NT_THREADS) -/* Windows support: use native Win7 primitives */ +/* + * Windows (XP, 2003 server and later, as well as (hopefully) CE) support + * + * Emulated condition variables ones that work with XP and later, plus + * example native support on VISTA and onwards. + */ #define Py_HAVE_CONDVAR /* include windows if it hasn't been done before */ #define WIN32_LEAN_AND_MEAN #include +/* options */ +/* non-emulated condition variables are provided for those that want + * to target Windows Vista. Modify this macro to enable them. + */ +#ifndef _PY_EMULATED_WIN_CV +#define _PY_EMULATED_WIN_CV 1 /* use emulated condition variables */ +#endif + +/* fall back to emulation if not targeting Vista */ +#if !defined NTDDI_VISTA || NTDDI_VERSION < NTDDI_VISTA +#undef _PY_EMULATED_WIN_CV +#define _PY_EMULATED_WIN_CV 1 +#endif + +#if _PY_EMULATED_WIN_CV + +typedef CRITICAL_SECTION PyMUTEX_T; + +/* The ConditionVariable object. From XP onwards it is easily emulated + with a Semaphore. + Semaphores are available on Windows XP (2003 server) and later. + We use a Semaphore rather than an auto-reset event, because although + an auto-resent event might appear to solve the lost-wakeup bug (race + condition between releasing the outer lock and waiting) because it + maintains state even though a wait hasn't happened, there is still + a lost wakeup problem if more than one thread are interrupted in the + critical place. A semaphore solves that, because its state is + counted, not Boolean. + Because it is ok to signal a condition variable with no one + waiting, we need to keep track of the number of + waiting threads. Otherwise, the semaphore's state could rise + without bound. This also helps reduce the number of "spurious wakeups" + that would otherwise happen. + */ + +typedef struct _PyCOND_T +{ + HANDLE sem; + int waiting; /* to allow PyCOND_SIGNAL to be a no-op */ +} PyCOND_T; + +#else /* !_PY_EMULATED_WIN_CV */ + +/* Use native Win7 primitives if build target is Win7 or higher */ + /* SRWLOCK is faster and better than CriticalSection */ typedef SRWLOCK PyMUTEX_T; typedef CONDITION_VARIABLE PyCOND_T; +#endif /* _PY_EMULATED_WIN_CV */ + #endif /* _POSIX_THREADS, NT_THREADS */ #endif /* Py_INTERNAL_CONDVAR_H */ diff --git a/Python/condvar.h b/Python/condvar.h index a983913dc737e5..951b8ad47f07be 100644 --- a/Python/condvar.h +++ b/Python/condvar.h @@ -97,6 +97,156 @@ PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, long long us) } #elif defined(NT_THREADS) +/* + * Windows (XP, 2003 server and later, as well as (hopefully) CE) support + * + * Emulated condition variables ones that work with XP and later, plus + * example native support on VISTA and onwards. + */ + +#if _PY_EMULATED_WIN_CV + +/* The mutex is a CriticalSection object and + The condition variables is emulated with the help of a semaphore. + + This implementation still has the problem that the threads woken + with a "signal" aren't necessarily those that are already + waiting. It corresponds to listing 2 in: + http://birrell.org/andrew/papers/ImplementingCVs.pdf + + Generic emulations of the pthread_cond_* API using + earlier Win32 functions can be found on the Web. + The following read can be give background information to these issues, + but the implementations are all broken in some way. + http://www.cse.wustl.edu/~schmidt/win32-cv-1.html +*/ + +Py_LOCAL_INLINE(int) +PyMUTEX_INIT(PyMUTEX_T *cs) +{ + InitializeCriticalSection(cs); + return 0; +} + +Py_LOCAL_INLINE(int) +PyMUTEX_FINI(PyMUTEX_T *cs) +{ + DeleteCriticalSection(cs); + return 0; +} + +Py_LOCAL_INLINE(int) +PyMUTEX_LOCK(PyMUTEX_T *cs) +{ + EnterCriticalSection(cs); + return 0; +} + +Py_LOCAL_INLINE(int) +PyMUTEX_UNLOCK(PyMUTEX_T *cs) +{ + LeaveCriticalSection(cs); + return 0; +} + + +Py_LOCAL_INLINE(int) +PyCOND_INIT(PyCOND_T *cv) +{ + /* A semaphore with a "large" max value, The positive value + * is only needed to catch those "lost wakeup" events and + * race conditions when a timed wait elapses. + */ + cv->sem = CreateSemaphore(NULL, 0, 100000, NULL); + if (cv->sem==NULL) + return -1; + cv->waiting = 0; + return 0; +} + +Py_LOCAL_INLINE(int) +PyCOND_FINI(PyCOND_T *cv) +{ + return CloseHandle(cv->sem) ? 0 : -1; +} + +/* this implementation can detect a timeout. Returns 1 on timeout, + * 0 otherwise (and -1 on error) + */ +Py_LOCAL_INLINE(int) +_PyCOND_WAIT_MS(PyCOND_T *cv, PyMUTEX_T *cs, DWORD ms) +{ + DWORD wait; + cv->waiting++; + PyMUTEX_UNLOCK(cs); + /* "lost wakeup bug" would occur if the caller were interrupted here, + * but we are safe because we are using a semaphore which has an internal + * count. + */ + wait = WaitForSingleObjectEx(cv->sem, ms, FALSE); + PyMUTEX_LOCK(cs); + if (wait != WAIT_OBJECT_0) + --cv->waiting; + /* Here we have a benign race condition with PyCOND_SIGNAL. + * When failure occurs or timeout, it is possible that + * PyCOND_SIGNAL also decrements this value + * and signals releases the mutex. This is benign because it + * just means an extra spurious wakeup for a waiting thread. + * ('waiting' corresponds to the semaphore's "negative" count and + * we may end up with e.g. (waiting == -1 && sem.count == 1). When + * a new thread comes along, it will pass right throuhgh, having + * adjusted it to (waiting == 0 && sem.count == 0). + */ + + if (wait == WAIT_FAILED) + return -1; + /* return 0 on success, 1 on timeout */ + return wait != WAIT_OBJECT_0; +} + +Py_LOCAL_INLINE(int) +PyCOND_WAIT(PyCOND_T *cv, PyMUTEX_T *cs) +{ + int result = _PyCOND_WAIT_MS(cv, cs, INFINITE); + return result >= 0 ? 0 : result; +} + +Py_LOCAL_INLINE(int) +PyCOND_TIMEDWAIT(PyCOND_T *cv, PyMUTEX_T *cs, long long us) +{ + return _PyCOND_WAIT_MS(cv, cs, (DWORD)(us/1000)); +} + +Py_LOCAL_INLINE(int) +PyCOND_SIGNAL(PyCOND_T *cv) +{ + /* this test allows PyCOND_SIGNAL to be a no-op unless required + * to wake someone up, thus preventing an unbounded increase of + * the semaphore's internal counter. + */ + if (cv->waiting > 0) { + /* notifying thread decreases the cv->waiting count so that + * a delay between notify and actual wakeup of the target thread + * doesn't cause a number of extra ReleaseSemaphore calls. + */ + cv->waiting--; + return ReleaseSemaphore(cv->sem, 1, NULL) ? 0 : -1; + } + return 0; +} + +Py_LOCAL_INLINE(int) +PyCOND_BROADCAST(PyCOND_T *cv) +{ + int waiting = cv->waiting; + if (waiting > 0) { + cv->waiting = 0; + return ReleaseSemaphore(cv->sem, waiting, NULL) ? 0 : -1; + } + return 0; +} + +#else /* !_PY_EMULATED_WIN_CV */ Py_LOCAL_INLINE(int) PyMUTEX_INIT(PyMUTEX_T *cs) @@ -167,6 +317,9 @@ PyCOND_BROADCAST(PyCOND_T *cv) return 0; } + +#endif /* _PY_EMULATED_WIN_CV */ + #endif /* _POSIX_THREADS, NT_THREADS */ #endif /* _CONDVAR_IMPL_H_ */ From 747ee70aa5c821261b10f18bdb5a9aab87273e71 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 18 Jan 2018 15:22:46 +0100 Subject: [PATCH 4/4] Revert: Keep _WIN32_WINNT_VISTA --- PC/pyconfig.h | 4 ++-- PC/pyshellext.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 4aa5ff469c1122..db745dee761777 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -132,8 +132,8 @@ WIN32 is still required for the locale module. #endif /* MS_WIN64 */ /* set the version macros for the windows headers */ -/* Python 3.7+ requires Windows 7 or greater */ -#define Py_WINVER 0x0601 /* _WIN32_WINNT_WIN7 */ +/* Python 3.5+ requires Windows Vista or greater */ +#define Py_WINVER 0x0600 /* _WIN32_WINNT_VISTA */ #define Py_NTDDI NTDDI_VISTA /* We only set these values when building Python - we don't want to force diff --git a/PC/pyshellext.cpp b/PC/pyshellext.cpp index 18c6c27a22e564..04fe61e89618bd 100644 --- a/PC/pyshellext.cpp +++ b/PC/pyshellext.cpp @@ -1,5 +1,5 @@ -// Support back to Windows 7 -#define _WIN32_WINNT _WIN32_WINNT_WIN7 +// Support back to Vista +#define _WIN32_WINNT _WIN32_WINNT_VISTA #include // Use WRL to define a classic COM class @@ -602,4 +602,4 @@ STDAPI_(BOOL) DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*) { DisableThreadLibraryCalls(hinst); } return TRUE; -} +} \ No newline at end of file