Skip to content

Commit 3f50bf6

Browse files
committed
Drop support for Windows 2000; allow any XP API (but not Vista+).
Drop SDK version configuration for Tk compilation, to not bind it to W2k anymore. Binding it to XP would conflict with Tk's own binding of tkMenu to W2k.
1 parent 6951fea commit 3f50bf6

6 files changed

Lines changed: 16 additions & 51 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ Tests
746746
Build
747747
-----
748748

749+
- Drop support for Windows 2000.
750+
749751
- Issue #17029: Let h2py search the multiarch system include directory.
750752

751753
- Issue #16953: Fix socket module compilation on platforms with

PC/pyconfig.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,9 @@ WIN32 is still required for the locale module.
156156
#endif /* MS_WIN64 */
157157

158158
/* set the version macros for the windows headers */
159-
#ifdef MS_WINX64
160-
/* 64 bit only runs on XP or greater */
159+
/* Python 3.4+ requires Windows XP or greater */
161160
#define Py_WINVER 0x0501 /* _WIN32_WINNT_WINXP */
162161
#define Py_NTDDI NTDDI_WINXP
163-
#else
164-
/* Python 2.6+ requires Windows 2000 or greater */
165-
#define Py_WINVER 0x0500 /* _WIN32_WINNT_WIN2K */
166-
#define Py_NTDDI NTDDI_WIN2KSP4
167-
#endif
168162

169163
/* We only set these values when building Python - we don't want to force
170164
these values on extensions, as that will affect the prototypes and

PCbuild/build_tkinter.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
TIX = "tix-8.4.3.x"
1717

1818
ROOT = os.path.abspath(os.path.join(here, par, par))
19-
# Windows 2000 compatibility: WINVER 0x0500
20-
# http://msdn2.microsoft.com/en-us/library/aa383745.aspx
21-
NMAKE = ('nmake /nologo /f %s '
22-
'COMPILERFLAGS=\"-DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DNTDDI_VERSION=NTDDI_WIN2KSP4\" '
23-
'%s %s')
19+
NMAKE = ('nmake /nologo /f %s %s %s')
2420

2521
def nmake(makefile, command="", **kw):
2622
defines = ' '.join(k+'='+str(v) for k, v in kw.items())

Python/random.c

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,16 @@ static int _Py_HashSecret_Initialized = 0;
1212
#endif
1313

1414
#ifdef MS_WINDOWS
15-
typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv,\
16-
LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType,\
17-
DWORD dwFlags );
18-
typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen,\
19-
BYTE *pbBuffer );
20-
21-
static CRYPTGENRANDOM pCryptGenRandom = NULL;
2215
/* This handle is never explicitly released. Instead, the operating
2316
system will release it when the process terminates. */
2417
static HCRYPTPROV hCryptProv = 0;
2518

2619
static int
2720
win32_urandom_init(int raise)
2821
{
29-
HINSTANCE hAdvAPI32 = NULL;
30-
CRYPTACQUIRECONTEXTA pCryptAcquireContext = NULL;
31-
32-
/* Obtain handle to the DLL containing CryptoAPI. This should not fail. */
33-
hAdvAPI32 = GetModuleHandle("advapi32.dll");
34-
if(hAdvAPI32 == NULL)
35-
goto error;
36-
37-
/* Obtain pointers to the CryptoAPI functions. This will fail on some early
38-
versions of Win95. */
39-
pCryptAcquireContext = (CRYPTACQUIRECONTEXTA)GetProcAddress(
40-
hAdvAPI32, "CryptAcquireContextA");
41-
if (pCryptAcquireContext == NULL)
42-
goto error;
43-
44-
pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(hAdvAPI32,
45-
"CryptGenRandom");
46-
if (pCryptGenRandom == NULL)
47-
goto error;
48-
4922
/* Acquire context */
50-
if (! pCryptAcquireContext(&hCryptProv, NULL, NULL,
51-
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
23+
if (!CryptAcquireContext(&hCryptProv, NULL, NULL,
24+
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
5225
goto error;
5326

5427
return 0;
@@ -77,7 +50,7 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
7750
while (size > 0)
7851
{
7952
chunk = size > INT_MAX ? INT_MAX : size;
80-
if (!pCryptGenRandom(hCryptProv, chunk, buffer))
53+
if (!CryptGenRandom(hCryptProv, chunk, buffer))
8154
{
8255
/* CryptGenRandom() failed */
8356
if (raise)

Tools/buildbot/external-amd64.bat

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
66

77
if not exist tcltk64\bin\tcl85g.dll (
88
cd tcl-8.5.11.0\win
9-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all
10-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install
9+
nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all
10+
nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install
1111
cd ..\..
1212
)
1313

1414
if not exist tcltk64\bin\tk85g.dll (
1515
cd tk-8.5.11.0\win
16-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 clean
17-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 all
18-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 install
16+
nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 clean
17+
nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 all
18+
nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 install
1919
cd ..\..
2020
)
2121

Tools/buildbot/external.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ call "%VS100COMNTOOLS%\vsvars32.bat"
77
if not exist tcltk\bin\tcl85g.dll (
88
@rem all and install need to be separate invocations, otherwise nmakehlp is not found on install
99
cd tcl-8.5.11.0\win
10-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk clean all
10+
nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk clean all
1111
nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install
1212
cd ..\..
1313
)
1414

1515
if not exist tcltk\bin\tk85g.dll (
1616
cd tk-8.5.11.0\win
17-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 clean
18-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 all
19-
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 install
17+
nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 clean
18+
nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 all
19+
nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 install
2020
cd ..\..
2121
)

0 commit comments

Comments
 (0)