Skip to content

Commit

Permalink
Merge pull request #38 from pelson/pid_race
Browse files Browse the repository at this point in the history
Attempt to fix #37.
  • Loading branch information
pelson authored Dec 16, 2016
2 parents fc3f650 + bac07fa commit 0c238ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions conda_execute/tmpenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,12 @@ def envs_and_running_pids():
newest_pid_time = creation_time

# Check if the process is still running.
alive = (pid in running_pids and
int(psutil.Process(pid).create_time()) == creation_time)
try:
alive = (pid in running_pids and
int(psutil.Process(pid).create_time()) == creation_time)
except psutil.NoSuchProcess:
alive = False

if alive:
alive_pids.append(pid)
env_stats = {'alive_PIDs': alive_pids, 'latest_creation_time': newest_pid_time}
Expand Down

0 comments on commit 0c238ae

Please sign in to comment.