Skip to content

Commit

Permalink
Ignore gpg-agent processes that are zombies
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Jul 13, 2018
1 parent 769c74d commit f25954f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pretty_bad_protocol/_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ def _find_agent(cls):
identity = this_process.uids

for proc in psutil.process_iter():
# In my system proc.name & proc.is_running are methods
if (proc.name() == "gpg-agent") and proc.is_running():
# Ensure that the process is running and is not a zombie.
if (proc.name() == "gpg-agent" and proc.is_running() and
proc.status() != psutil.STATUS_ZOMBIE):
log.debug("Found gpg-agent process with pid %d" % proc.pid)
if _util._running_windows:
if proc.username() == identity:
Expand Down

0 comments on commit f25954f

Please sign in to comment.