def stop_workers(worker_sockets, log_fh=None):
 for (i, worker) in enumerate(worker_sockets):
  try:
   worker.send('Server shutting down all clients')
  except error:
   if log_fh:
    log_fh.write(('Worker %s seems to be dead already. Check for runaways!\n' % i))
  worker.close()

def stop_workers ( worker_sockets , log_fh = None ) : for ( i , worker ) in enumerate ( worker_sockets ) : try : worker . send ( 'Server shutting down all clients' ) except error : if log_fh : log_fh . write ( ( 'Worker %s seems to be dead already. Check for runaways!\n' % i ) ) worker . close ( )
stop all workers .