Skip to content

Commit

Permalink
#1044: threads() was incorrectly raising AD instead of ZombieProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jun 2, 2017
1 parent 0549234 commit 5bad311
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion psutil/_psosx.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ def status(self):

@wrap_exceptions
def threads(self):
rawlist = cext.proc_threads(self.pid)
with catch_zombie(self):
rawlist = cext.proc_threads(self.pid)
retlist = []
for thread_id, utime, stime in rawlist:
ntuple = _common.pthread(thread_id, utime, stime)
Expand Down
5 changes: 1 addition & 4 deletions psutil/_psutil_osx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
// task_for_pid() requires special privileges
err = task_for_pid(mach_task_self(), (pid_t)pid, &task);
if (err != KERN_SUCCESS) {
if (psutil_pid_exists(pid) == 0)
NoSuchProcess();
else
AccessDenied();
psutil_raise_for_pid(pid, "task_for_pid() failed");
goto error;
}

Expand Down

0 comments on commit 5bad311

Please sign in to comment.