Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8064a8

Browse files
committed
asyncio doc: close explicitly event loops
1 parent 7579093 commit b8064a8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Doc/library/asyncio-dev.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Example of unhandled exception::
212212
loop = asyncio.get_event_loop()
213213
asyncio.async(bug())
214214
loop.run_forever()
215+
loop.close()
215216

216217
Output::
217218

@@ -258,6 +259,7 @@ coroutine in another coroutine and use classic try/except::
258259
loop = asyncio.get_event_loop()
259260
asyncio.async(handle_exception())
260261
loop.run_forever()
262+
loop.close()
261263

262264
Another option is to use the :meth:`BaseEventLoop.run_until_complete`
263265
function::

0 commit comments

Comments
 (0)