Skip to content

Commit d77d139

Browse files
committed
make BlockingPortal.stop sync
1 parent 5591099 commit d77d139

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/anyio/from_thread.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def sleep_until_stopped(self) -> None:
143143
"""Sleep until :meth:`stop` is called."""
144144
await self._stop_event.wait()
145145

146-
async def stop(self, cancel_remaining: bool = False) -> None:
146+
def stop(self, cancel_remaining: bool = False) -> DeprecatedAwaitable:
147147
"""
148148
Signal the portal to shut down.
149149
@@ -159,6 +159,8 @@ async def stop(self, cancel_remaining: bool = False) -> None:
159159
if cancel_remaining:
160160
self._task_group.cancel_scope.cancel()
161161

162+
return DeprecatedAwaitable(self.stop)
163+
162164
async def _call_func(self, func: Callable, args: tuple, kwargs: Dict[str, Any],
163165
future: Future) -> None:
164166
def callback(f: Future) -> None:

0 commit comments

Comments
 (0)