Skip to content

Commit 5d940e0

Browse files
committed
Rerun gen_exports
1 parent f6c3325 commit 5d940e0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

trio/_core/_generated_run.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ def spawn_system_task(async_fn, *args, name=None):
126126
127127
* System tasks do not inherit context variables from their creator.
128128
129+
Towards the end of a call to :meth:`trio.run`, after the main
130+
task and all system tasks have exited, the system nursery
131+
becomes closed. At this point, new calls to
132+
:func:`spawn_system_task` will raise ``RuntimeError("Nursery
133+
is closed to new arrivals")`` instead of creating a system
134+
task. It's possible to encounter this state either in
135+
a ``finally`` block in an async generator, or in a callback
136+
passed to :meth:`TrioToken.run_sync_soon` at the right moment.
137+
129138
Args:
130139
async_fn: An async callable.
131140
args: Positional arguments for ``async_fn``. If you want to pass

0 commit comments

Comments
 (0)