From c7def9e57fabcb6da48d30f77e5d40aa490c7076 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Sun, 24 Feb 2019 15:22:56 -0800 Subject: instead of raising exception print DEBUG message (we can't crash on import) --- psutil/_psutil_windows.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 1e2894a8..8167503c 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -3724,8 +3724,12 @@ void init_psutil_windows(void) module, "ERROR_SERVICE_DOES_NOT_EXIST", ERROR_SERVICE_DOES_NOT_EXIST); // set SeDebug for the current process - if (psutil_set_se_debug() != 0) - return NULL; + if (psutil_set_se_debug() != 0) { + PyErr_Clear(); + if (PSUTIL_DEBUG) + psutil_debug("SE DEBUG process mode not set"); + } + psutil_setup(); if (psutil_load_globals() != 0) return NULL; -- cgit v1.2.1