Skip to content

Commit 4dd3cc6

Browse files
committed
fix: close the Client's aio session if the websocket fails to connect
1 parent e563f96 commit 4dd3cc6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/textual_dev/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ async def connect(self) -> None:
118118
f"{self.url}/textual-devtools-websocket"
119119
)
120120
except (ClientConnectorError, ClientResponseError):
121+
await self.session.close()
122+
self.session = None
121123
raise DevtoolsConnectionError()
122124

123125
log_queue = self.log_queue

0 commit comments

Comments
 (0)