Skip to content

Commit e0e02b1

Browse files
committed
gh-152433: Windows: implement os.cpu_count() for UWP
1 parent 9751e1d commit e0e02b1

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implement os.cpu_count() for UWP.

Modules/posixmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16008,7 +16008,9 @@ os_cpu_count_impl(PyObject *module)
1600816008
# ifdef MS_WINDOWS_DESKTOP
1600916009
ncpu = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
1601016010
# else
16011-
ncpu = 0;
16011+
SYSTEM_INFO sysinfo;
16012+
GetSystemInfo(&sysinfo);
16013+
ncpu = sysinfo.dwNumberOfProcessors;
1601216014
# endif
1601316015

1601416016
#elif defined(__hpux)

0 commit comments

Comments
 (0)