]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-152433: Windows: enable mmapmodule for UWP (#152473)
authorthexai <58434170+thexai@users.noreply.github.com>
Tue, 30 Jun 2026 20:49:01 +0000 (22:49 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 20:49:01 +0000 (22:49 +0200)
Misc/NEWS.d/next/Windows/2026-06-29-16-29-50.gh-issue-152433._nhCjt.rst [new file with mode: 0644]
Modules/mmapmodule.c
PC/config.c

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 (file)
index 0000000..0c420c1
--- /dev/null
@@ -0,0 +1,2 @@
+Restores the ``mmap`` module when CPython is built from source for specific
+Windows API sets.
index f4f21b45f920a0014fc4fa8c3cd0b2d45699666b..d55ab3d4d56edb02a18e54c7ebd0e78649d4568e 100644 (file)
@@ -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;                                                  \
index 51b46c64d99b816ca6e239e808669da32c79a0bc..dcccc6a3a6d01675ed980032899d645b0005dbbb 100644 (file)
@@ -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},