diff options
author | Pamela Fox <pamela.fox@gmail.com> | 2022-09-04 18:33:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-04 18:33:50 -0700 |
commit | a0ad63e70e3682cdf7e87e28091bb54fe12a2d4e (patch) | |
tree | 8a2b64598dc2578cdaf9b53a4a984202bba9d066 /Lib/asyncio | |
parent | ac1866547243ade5392ed9bc6e7989f4d4346594 (diff) | |
download | cpython-a0ad63e70e3682cdf7e87e28091bb54fe12a2d4e.tar.gz cpython-a0ad63e70e3682cdf7e87e28091bb54fe12a2d4e.zip |
gh-93973: Add all_errors to asyncio.create_connection (#93974)
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/base_events.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index fa00bf9a2ca..a675fff1688 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -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: |