Skip to content

Commit

Permalink
fix on trio on py < 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Oct 13, 2024
1 parent 222c6cd commit a2baf53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/anyio/_core/_sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ async def try_connect(remote_host: str, event: Event) -> None:
cause = (
oserrors[0]
if len(oserrors) == 1
else ExceptionGroup("multiple connection attempts failed", oserrors)
else ExceptionGroup(
"multiple connection attempts failed", oserrors.copy()
)
)
raise OSError("All connection attempts failed") from cause
finally:
oserrors = []
oserrors.clear()

if tls or tls_hostname or ssl_context:
try:
Expand Down

0 comments on commit a2baf53

Please sign in to comment.