This repository was archived by the owner on Apr 15, 2024. It is now read-only.
Commit 598813c
committed
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: [<a long list of 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.1 parent 53eb41c commit 598813c
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
0 commit comments