python-consul
python-consul copied to clipboard
aio: return session closing coroutine
aio.Consul.close() uses aiohttp.ClientSession.close() which returns a coroutine that was never awaited. When this happens, RuntimeWarnings are raised on termination:
RuntimeWarning: coroutine 'ClientSession.close' was never awaited self._session.close() RuntimeWarning: Enable tracemalloc to get the object allocation traceback Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7fee7d894340> Unclosed connector connections: [] connector: <aiohttp.connector.TCPConnector object at 0x7fee7d894310>
In this change the coroutine will be returned so it could be awaited and by that avoids these warnings.
@RazAnyVision Interested in coming here ?