def wait_for_free_port(host, port, timeout=None):
 if (not host):
  raise ValueError("Host values of '' or None are not allowed.")
 if (timeout is None):
  timeout = free_port_timeout
 for trial in range(50):
  try:
   check_port(host, port, timeout=timeout)
  except IOError:
   time.sleep(timeout)
  else:
   return
 raise IOError(('Port %r not free on %r' % (port, host)))

def wait_for_free_port ( host , port , timeout = None ) : if ( not host ) : raise ValueError ( "Host values of '' or None are not allowed." ) if ( timeout is None ) : timeout = free_port_timeout for trial in range ( 50 ) : try : check_port ( host , port , timeout = timeout ) except IOError : time . sleep ( timeout ) else : return raise IOError ( ( 'Port %r not free on %r' % ( port , host ) ) )
wait for the specified port to become free .