We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
trio.sleep_forever
RuntimeError
1 parent c47758c commit 3d592afCopy full SHA for 3d592af
newsfragments/3113.doc.rst
@@ -0,0 +1 @@
1
+Document that :func:`trio.sleep_forever` is guaranteed to raise an exception now.
src/trio/_timeouts.py
@@ -61,7 +61,11 @@ def move_on_after(
61
async def sleep_forever() -> NoReturn:
62
"""Pause execution of the current task forever (or until cancelled).
63
64
- Equivalent to calling ``await sleep(math.inf)``.
+ Equivalent to calling ``await sleep(math.inf)``, except that if manually
65
+ rescheduled this will raise a `RuntimeError`.
66
+
67
+ Raises:
68
+ RuntimeError: if rescheduled
69
70
"""
71
await trio.lowlevel.wait_task_rescheduled(lambda _: trio.lowlevel.Abort.SUCCEEDED)
0 commit comments