Skip to content

Commit d96aa51

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

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
@@ -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)