summaryrefslogtreecommitdiff
path: root/psutil/arch
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2022-05-17 15:44:23 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2022-05-17 15:44:23 +0200
commit33981759a67601b91d925a14403077e8d218c015 (patch)
treeca0c2c500cb6ca6b895ebd569a014a5a104157ba /psutil/arch
parent51cd8470eee87d8f69226a58f73e29e2ddad794a (diff)
downloadpsutil-33981759a67601b91d925a14403077e8d218c015.tar.gz
#2105: give hint on how to solve the problem if PdhAddEnglishCounter fails
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'psutil/arch')
-rw-r--r--psutil/arch/windows/wmi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/psutil/arch/windows/wmi.c b/psutil/arch/windows/wmi.c
index 5fad4053..fc7a6652 100644
--- a/psutil/arch/windows/wmi.c
+++ b/psutil/arch/windows/wmi.c
@@ -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;
}