Skip to content

Commit 6cf2d51

Browse files
committed
Don't cancel wait_readable()
1 parent b3e2e07 commit 6cf2d51

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/zmq_anyio/_socket.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -895,19 +895,19 @@ async def _start(self, *, task_status: TaskStatus[None] = TASK_STATUS_IGNORED):
895895
self._task_group,
896896
exception_handler=ignore_exceptions,
897897
)
898+
wait_readable_task = create_task(
899+
wait_readable(self._shadow_sock), # type: ignore[arg-type]
900+
self._task_group,
901+
exception_handler=ignore_exceptions,
902+
)
898903
tasks = [
899-
create_task(
900-
wait_readable(self._shadow_sock), # type: ignore[arg-type]
901-
self._task_group,
902-
exception_handler=ignore_exceptions,
903-
),
904+
wait_readable_task,
904905
wait_stopped_task,
905906
]
906907
done, pending = await wait(
907908
tasks, self._task_group, return_when=FIRST_COMPLETED
908909
)
909-
for task in pending:
910-
task.cancel()
910+
wait_stopped_task.cancel()
911911
if wait_stopped_task in done:
912912
break
913913
await self._handle_events()

0 commit comments

Comments
 (0)