RequestsFetcher: satisfy mypy with small fix

The typeshed annotations for requests say that the hostname could be None:
I think this is untrue but let's keep mypy happy.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This commit is contained in:
Jussi Kukkonen 2022-10-28 13:32:52 +03:00 committed by KOLANICH
parent 0c9c494261
commit 35a7dd58c5

View file

@ -121,7 +121,7 @@ def _get_session(self, url: str) -> requests.Session:
if not parsed_url.scheme:
raise exceptions.DownloadError(f"Failed to parse URL {url}")
session_index = (parsed_url.scheme, parsed_url.hostname)
session_index = (parsed_url.scheme, parsed_url.hostname or "")
session = self._sessions.get(session_index)
if not session: