def registerReapProcessHandler(pid, process):
 if (pid in reapProcessHandlers):
  raise RuntimeError('Try to register an already registered process.')
 try:
  (auxPID, status) = os.waitpid(pid, os.WNOHANG)
 except:
  log.msg(('Failed to reap %d:' % pid))
  log.err()
  auxPID = None
 if auxPID:
  process.processEnded(status)
 else:
  reapProcessHandlers[pid] = process

def registerReapProcessHandler ( pid , process ) : if ( pid in reapProcessHandlers ) : raise RuntimeError ( 'Try to register an already registered process.' ) try : ( auxPID , status ) = os . waitpid ( pid , os . WNOHANG ) except : log . msg ( ( 'Failed to reap %d:' % pid ) ) log . err ( ) auxPID = None if auxPID : process . processEnded ( status ) else : reapProcessHandlers [ pid ] = process
register a process handler for the given pid .