https://github.com/python/cpython/commit/a5be0d81cb74fabe563b8317f94d80aa01c9bbf9
commit: a5be0d81cb74fabe563b8317f94d80aa01c9bbf9
branch: main
author: thexai <[email protected]>
committer: chris-eibl <[email protected]>
date: 2026-06-30T22:49:01+02:00
summary:
gh-152433: Windows: enable mmapmodule for UWP (#152473)
files:
A Misc/NEWS.d/next/Windows/2026-06-29-16-29-50.gh-issue-152433._nhCjt.rst
M Modules/mmapmodule.c
M 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
index 000000000000000..0c420c124c2981f
--- /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 f4f21b45f920a00..d55ab3d4d56edb0 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 51b46c64d99b816..dcccc6a3a6d0167 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},
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]