diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-01-15 19:07:38 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-01-15 19:07:38 +0100 |
commit | 4ad3380bb312b6ea06717e3adc1f60ac8daf4a05 (patch) | |
tree | 923f2b548ada7533fb6e794b8253941ec225b6f6 /psutil/_psutil_windows.c | |
parent | 3223228b0558e42508cf9f8cce84d89c79b5c52b (diff) | |
parent | e80cabe5206fd7ef14fd6a47e2571f660f95babf (diff) | |
download | psutil-new-cpu-count.tar.gz |
Merge branch 'master' into new-cpu-countnew-cpu-count
Diffstat (limited to 'psutil/_psutil_windows.c')
-rw-r--r-- | psutil/_psutil_windows.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 1ac98a07..1b813f99 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -44,35 +44,6 @@ static PyObject *TimeoutAbandoned; /* - * Return the number of logical, active CPUs. Return 0 if undetermined. - * See discussion at: https://bugs.python.org/issue33166#msg314631 - */ -unsigned int -psutil_get_num_cpus(int fail_on_err) { - unsigned int ncpus = 0; - - // Minimum requirement: Windows 7 - if (GetActiveProcessorCount != NULL) { - ncpus = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS); - if ((ncpus == 0) && (fail_on_err == 1)) { - PyErr_SetFromWindowsErr(0); - } - } - else { - psutil_debug("GetActiveProcessorCount() not available; " - "using GetSystemInfo()"); - ncpus = (unsigned int)PSUTIL_SYSTEM_INFO.dwNumberOfProcessors; - if ((ncpus <= 0) && (fail_on_err == 1)) { - PyErr_SetString( - PyExc_RuntimeError, - "GetSystemInfo() failed to retrieve CPU count"); - } - } - return ncpus; -} - - -/* * Return a Python float representing the system uptime expressed in seconds * since the epoch. */ |