def __init__( self, host: str, timeout: Optional[Union[float, Timeout]] = None, ) -> None: if isinstance(timeout, float): timeout = Timeout.from_float(timeout) _ = host
def __init__( self, host: str, timeout: Optional[Union[float, Timeout]] = None, ) -> None: if isinstance(timeout, float): timeout = Timeout.from_float(timeout) super().__init__("localhost", timeout=timeout, retries=10) self.host = host
def urlopen(*args, **kwargs): timeout = kwargs.pop("timeout", None) if isinstance(timeout, Timeout): timeout = Timeout.from_float(timeout.connect_timeout) return orig_urlopen(*args, timeout=timeout, **kwargs)