Skip to content

Commit 0af6f33

Browse files
committed
Cancel nursery before closing connection (fixes #5)
This regression was introduced at a8cbe89 because as I refactored I mistakenly removed the nursery.cancel_scope.cancel(), which is still needed. This isn't the cleanest way to handle connection closed, but it's the smallest change that fixes the build, and its based on code that existed in the last successful build.
1 parent 905b3a9 commit 0af6f33

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

trio_cdp/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ async def open_cdp_connection(url) -> typing.AsyncIterator[CdpConnection]:
305305
async with cdp_conn:
306306
nursery.start_soon(cdp_conn._reader_task)
307307
yield cdp_conn
308+
nursery.cancel_scope.cancel()
308309

309310

310311
async def connect_cdp(nursery, url) -> CdpConnection:

0 commit comments

Comments
 (0)