Skip to content

Commit

Permalink
fix(connect): Future exception was never retrieved on close() (#2427)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed May 2, 2024
1 parent 5b64618 commit cb94c25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions playwright/_impl/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ def cleanup(self, cause: Exception = None) -> None:
for ws_connection in self._child_ws_connections:
ws_connection._transport.dispose()
for callback in self._callbacks.values():
# To prevent 'Future exception was never retrieved' we ignore all callbacks that are no_reply.
if callback.no_reply:
continue
callback.future.set_exception(self._closed_error)
self._callbacks.clear()
self.emit("close")
Expand Down

0 comments on commit cb94c25

Please sign in to comment.