Fixed #31407 -- Fixed unawaited coroutine warning for Python 3.8+.

Co-authored-by: Mark Korput <dr.theman@gmail.com>
This commit is contained in:
Carlton Gibson 2020-04-09 11:56:01 +02:00 committed by Carlton Gibson
parent 377018b6ff
commit ed274a4ae4
1 changed files with 3 additions and 0 deletions

View File

@ -58,5 +58,8 @@ class CoroutineClearingView:
self._unawaited_coroutine = asyncio.sleep(0)
return self._unawaited_coroutine
def __del__(self):
self._unawaited_coroutine.close()
async_unawaited = CoroutineClearingView()