From: Victor Stinner Date: Mon, 23 Feb 2015 10:41:56 +0000 (+0100) Subject: asyncio doc: close explicitly event loops X-Git-Tag: v3.5.0a2~94^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8064a8a16b63a929f94af300624bb239671ad82;p=python asyncio doc: close explicitly event loops --- diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index bf77a8fb79..d7f474efae 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -212,6 +212,7 @@ Example of unhandled exception:: loop = asyncio.get_event_loop() asyncio.async(bug()) loop.run_forever() + loop.close() Output:: @@ -258,6 +259,7 @@ coroutine in another coroutine and use classic try/except:: loop = asyncio.get_event_loop() asyncio.async(handle_exception()) loop.run_forever() + loop.close() Another option is to use the :meth:`BaseEventLoop.run_until_complete` function::