https://github.com/python/cpython/commit/d7b171b6b32c823f28ba974e7c80c4fdfe78c98e
commit: d7b171b6b32c823f28ba974e7c80c4fdfe78c98e
branch: main
author: thexai <[email protected]>
committer: zware <[email protected]>
date: 2026-07-18T07:19:03-05:00
summary:
gh-152433: Windows: implement ``os.cpu_count()`` for UWP (GH-152479)
files:
A Misc/NEWS.d/next/Windows/2026-06-28-12-37-08.gh-issue-152433.FTMgqF.rst
M Modules/posixmodule.c
diff --git
a/Misc/NEWS.d/next/Windows/2026-06-28-12-37-08.gh-issue-152433.FTMgqF.rst
b/Misc/NEWS.d/next/Windows/2026-06-28-12-37-08.gh-issue-152433.FTMgqF.rst
new file mode 100644
index 000000000000000..bd295fb4dd603f5
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2026-06-28-12-37-08.gh-issue-152433.FTMgqF.rst
@@ -0,0 +1 @@
+Implement :func:`os.cpu_count` for Universal Windows Platform.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 36debd6fe7aa153..4c26ee52279abcd 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -16003,7 +16003,9 @@ os_cpu_count_impl(PyObject *module)
# ifdef MS_WINDOWS_DESKTOP
ncpu = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
# else
- ncpu = 0;
+ SYSTEM_INFO sysinfo;
+ GetSystemInfo(&sysinfo);
+ ncpu = sysinfo.dwNumberOfProcessors;
# endif
#elif defined(__hpux)
_______________________________________________
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]