From f52e44b56a198bfc4729159b1a475ab7b03e9aac Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 28 Feb 2019 12:42:23 -0500 Subject: [PATCH] typing --- lbrynet/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbrynet/utils.py b/lbrynet/utils.py index 82c1ac738..f48751c48 100644 --- a/lbrynet/utils.py +++ b/lbrynet/utils.py @@ -163,14 +163,14 @@ async def resolve_host(url: str, port: int, proto: str) -> str: ))[0][4][0] -def get_ssl_context(): +def get_ssl_context() -> ssl.SSLContext: return ssl.create_default_context( purpose=ssl.Purpose.CLIENT_AUTH, capath=None if 'darwin' not in sys.platform else certifi.where() ) @contextlib.asynccontextmanager -async def aiohttp_request(method, url, **kwargs): +async def aiohttp_request(method, url, **kwargs) -> typing.AsyncContextManager[aiohttp.ClientResponse]: async with aiohttp.ClientSession() as session: async with session.request(method, url, ssl=get_ssl_context(), **kwargs) as response: yield response