Skip to content

Commit

Permalink
#2105: give hint on how to solve the problem if PdhAddEnglishCounter …
Browse files Browse the repository at this point in the history
…fails

Signed-off-by: Giampaolo Rodola <[email protected]>
  • Loading branch information
giampaolo committed May 17, 2022
1 parent 51cd847 commit 3398175
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion psutil/arch/windows/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ psutil_init_loadavg_counter(PyObject *self, PyObject *args) {

s = PdhAddEnglishCounterW(hQuery, szCounterPath, 0, &hCounter);
if (s != ERROR_SUCCESS) {
PyErr_Format(PyExc_RuntimeError, "PdhAddEnglishCounterW failed");
PyErr_Format(
PyExc_RuntimeError,
"PdhAddEnglishCounterW failed. Performance counters may be disabled."
);
return NULL;
}

Expand Down

0 comments on commit 3398175

Please sign in to comment.