Skip to content

Commit 094fc47

Browse files
committed
remove deprecated Stop exception type
1 parent 4d2e956 commit 094fc47

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/reactpy/core/serve.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525
"""
2626

2727

28-
class Stop(BaseException):
29-
"""Deprecated
30-
31-
Stop serving changes and events
32-
33-
Raising this error will tell dispatchers to gracefully exit. Typically this is
34-
called by code running inside a layout to tell it to stop rendering.
35-
"""
36-
37-
3828
async def serve_layout(
3929
layout: LayoutType[
4030
LayoutUpdateMessage | dict[str, Any], LayoutEventMessage | dict[str, Any]
@@ -44,17 +34,9 @@ async def serve_layout(
4434
) -> None:
4535
"""Run a dispatch loop for a single view instance"""
4636
async with layout:
47-
try:
48-
async with create_task_group() as task_group:
49-
task_group.start_soon(_single_outgoing_loop, layout, send)
50-
task_group.start_soon(_single_incoming_loop, task_group, layout, recv)
51-
except Stop: # nocov
52-
warn(
53-
"The Stop exception is deprecated and will be removed in a future version",
54-
UserWarning,
55-
stacklevel=1,
56-
)
57-
logger.info(f"Stopped serving {layout}")
37+
async with create_task_group() as task_group:
38+
task_group.start_soon(_single_outgoing_loop, layout, send)
39+
task_group.start_soon(_single_incoming_loop, task_group, layout, recv)
5840

5941

6042
async def _single_outgoing_loop(

0 commit comments

Comments
 (0)