summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-02-24 15:22:56 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-02-24 15:22:56 -0800
commitc7def9e57fabcb6da48d30f77e5d40aa490c7076 (patch)
tree1ff548881a2455b3cd5c97dcf57800947fd05dcc
parent961a5ac2363c41282f1a89b87a261a6d15a8c278 (diff)
downloadpsutil-fix-win-set-debug.tar.gz
instead of raising exception print DEBUG message (we can't crash on import)fix-win-set-debug
-rw-r--r--psutil/_psutil_windows.c8
1 files 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;