Skip to content

Commit af9bdf3

Browse files
committed
gh-152433: Windows: implement os.cpu_count() for UWP
1 parent 95bfaff commit af9bdf3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/posixmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15990,7 +15990,9 @@ os_cpu_count_impl(PyObject *module)
1599015990
# ifdef MS_WINDOWS_DESKTOP
1599115991
ncpu = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
1599215992
# else
15993-
ncpu = 0;
15993+
SYSTEM_INFO sysinfo;
15994+
GetSystemInfo(&sysinfo);
15995+
ncpu = sysinfo.dwNumberOfProcessors;
1599415996
# endif
1599515997

1599615998
#elif defined(__hpux)

0 commit comments

Comments
 (0)