def signal_pid(pid, sig):
 try:
  os.kill(pid, sig)
 except OSError:
  pass
 for i in range(5):
  if (not pid_is_alive(pid)):
   return True
  time.sleep(1)
 return False

def signal_pid ( pid , sig ) : try : os . kill ( pid , sig ) except OSError : pass for i in range ( 5 ) : if ( not pid_is_alive ( pid ) ) : return True time . sleep ( 1 ) return False
sends a signal to a process id .