diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-24 22:08:17 -0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-24 22:08:17 -0800 |
commit | 27f211e45ac0b6a49cdaa29921ae1fb6e2895380 (patch) | |
tree | 40487695a964ffa60baa077962fe156d37f6a2ea | |
parent | 5bf3554a323ffd19172efd3015c65977b09f2887 (diff) | |
download | psutil-27f211e45ac0b6a49cdaa29921ae1fb6e2895380.tar.gz |
code path was not executed
-rw-r--r-- | psutil/arch/windows/process_utils.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/psutil/arch/windows/process_utils.c b/psutil/arch/windows/process_utils.c index 43d46b32..f029625e 100644 --- a/psutil/arch/windows/process_utils.c +++ b/psutil/arch/windows/process_utils.c @@ -152,7 +152,6 @@ psutil_pid_is_running(pid_t pid) { return 1; if (pid < 0) return 0; - return psutil_pid_in_pids(pid); hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid); @@ -167,9 +166,6 @@ psutil_pid_is_running(pid_t pid) { } CloseHandle(hProcess); - if ((PSUTIL_TESTING) && (psutil_pid_in_pids(pid) == 1)) { - PyErr_SetString(PyExc_AssertionError, "NULL handle but PID exists"); - return -1; - } - return 0; + PyErr_Clear(); + return psutil_pid_in_pids(pid); } |