Kaydet (Commit) 7caa615f authored tarafından Victor Stinner's avatar Victor Stinner

Merge 3.4 (asyncio doc)

...@@ -212,6 +212,7 @@ Example of unhandled exception:: ...@@ -212,6 +212,7 @@ Example of unhandled exception::
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
asyncio.async(bug()) asyncio.async(bug())
loop.run_forever() loop.run_forever()
loop.close()
Output:: Output::
...@@ -258,6 +259,7 @@ coroutine in another coroutine and use classic try/except:: ...@@ -258,6 +259,7 @@ coroutine in another coroutine and use classic try/except::
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
asyncio.async(handle_exception()) asyncio.async(handle_exception())
loop.run_forever() loop.run_forever()
loop.close()
Another option is to use the :meth:`BaseEventLoop.run_until_complete` Another option is to use the :meth:`BaseEventLoop.run_until_complete`
function:: function::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment