mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-93973: Add all_errors to asyncio.create_connection (#93974)
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
This commit is contained in:
parent
ac18665472
commit
a0ad63e70e
4 changed files with 54 additions and 2 deletions
|
@ -980,7 +980,8 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
local_addr=None, server_hostname=None,
|
||||
ssl_handshake_timeout=None,
|
||||
ssl_shutdown_timeout=None,
|
||||
happy_eyeballs_delay=None, interleave=None):
|
||||
happy_eyeballs_delay=None, interleave=None,
|
||||
all_errors=False):
|
||||
"""Connect to a TCP server.
|
||||
|
||||
Create a streaming transport connection to a given internet host and
|
||||
|
@ -1069,6 +1070,8 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
|
||||
if sock is None:
|
||||
exceptions = [exc for sub in exceptions for exc in sub]
|
||||
if all_errors:
|
||||
raise ExceptionGroup("create_connection failed", exceptions)
|
||||
if len(exceptions) == 1:
|
||||
raise exceptions[0]
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue