summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortonycpsu <tonycpsu@gmail.com>2021-02-14 13:06:24 -0500
committerGitHub <noreply@github.com>2021-02-14 13:06:24 -0500
commit9626fb48ab39456e7154106d281a43adf17c9107 (patch)
tree25f22ade16b5811e5d174c0648928115ebc182d4
parentc98faf1bb1dc81a340648f0b4618d88e24fe5bfb (diff)
parent59b2942405771f645ef5215dabab8084ac65db1f (diff)
downloadurwid-9626fb48ab39456e7154106d281a43adf17c9107.tar.gz
Merge pull request #438 from collmot/fix/doc-fix-TrioEventLoop-run-async
Fix documentation of TrioEventLoop.run_async()
-rw-r--r--urwid/_async_kw_event_loop.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/urwid/_async_kw_event_loop.py b/urwid/_async_kw_event_loop.py
index d146a49..5138526 100644
--- a/urwid/_async_kw_event_loop.py
+++ b/urwid/_async_kw_event_loop.py
@@ -136,10 +136,15 @@ class TrioEventLoop(EventLoop):
Trio event loop is already running. Example::
with trio.open_nursery() as nursery:
- event_loop = urwid.TrioEventLoop(nursery=nursery)
+ event_loop = urwid.TrioEventLoop()
+
+ # [...launch other async tasks in the nursery...]
+
loop = urwid.MainLoop(widget, event_loop=event_loop)
with loop.start():
await event_loop.run_async()
+
+ nursery.cancel_scope.cancel()
"""
idle_callbacks = self._idle_callbacks