def is_pidfile_stale(pidfile):
 result = False
 pidfile_pid = pidfile.read_pid()
 if (pidfile_pid is not None):
  try:
   os.kill(pidfile_pid, signal.SIG_DFL)
  except OSError as exc:
   if (exc.errno == errno.ESRCH):
    result = True
 return result

def is_pidfile_stale ( pidfile ) : result = False pidfile_pid = pidfile . read_pid ( ) if ( pidfile_pid is not None ) : try : os . kill ( pidfile_pid , signal . SIG_DFL ) except OSError as exc : if ( exc . errno == errno . ESRCH ) : result = True return result
determine whether a pid file is stale .