]> granicus.if.org Git - python/commitdiff
asyncio doc: close explicitly event loops
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 23 Feb 2015 10:41:56 +0000 (11:41 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 23 Feb 2015 10:41:56 +0000 (11:41 +0100)
Doc/library/asyncio-dev.rst

index bf77a8fb794573e494875fb117b4d1598f264dbb..d7f474efae3ba0cc551fd1ea55dfceedec8337f7 100644 (file)
@@ -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::