From: thexai <58434170+thexai@users.noreply.github.com> Date: Tue, 30 Jun 2026 20:49:01 +0000 (+0200) Subject: gh-152433: Windows: enable mmapmodule for UWP (#152473) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a5be0d81cb74fabe563b8317f94d80aa01c9bbf9;p=thirdparty%2FPython%2Fcpython.git gh-152433: Windows: enable mmapmodule for UWP (#152473) --- diff --git a/Misc/NEWS.d/next/Windows/2026-06-29-16-29-50.gh-issue-152433._nhCjt.rst b/Misc/NEWS.d/next/Windows/2026-06-29-16-29-50.gh-issue-152433._nhCjt.rst new file mode 100644 index 000000000000..0c420c124c29 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2026-06-29-16-29-50.gh-issue-152433._nhCjt.rst @@ -0,0 +1,2 @@ +Restores the ``mmap`` module when CPython is built from source for specific +Windows API sets. diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index f4f21b45f920..d55ab3d4d56e 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -338,7 +338,7 @@ _PyErr_SetFromNTSTATUS(ULONG status) } #endif -#if defined(MS_WINDOWS) && !defined(DONT_USE_SEH) +#if defined(MS_WINDOWS_DESKTOP) && !defined(DONT_USE_SEH) #define HANDLE_INVALID_MEM(sourcecode) \ do { \ EXCEPTION_RECORD record; \ @@ -364,7 +364,7 @@ do { \ } while (0) #endif -#if defined(MS_WINDOWS) && !defined(DONT_USE_SEH) +#if defined(MS_WINDOWS_DESKTOP) && !defined(DONT_USE_SEH) #define HANDLE_INVALID_MEM_METHOD(self, sourcecode) \ do { \ EXCEPTION_RECORD record; \ diff --git a/PC/config.c b/PC/config.c index 51b46c64d99b..dcccc6a3a6d0 100644 --- a/PC/config.c +++ b/PC/config.c @@ -140,7 +140,7 @@ struct _inittab _PyImport_Inittab[] = { {"itertools", PyInit_itertools}, {"_collections", PyInit__collections}, {"_symtable", PyInit__symtable}, -#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_GAMES) +#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_GAMES) || defined(MS_WINDOWS_APP) {"mmap", PyInit_mmap}, #endif {"_csv", PyInit__csv},