aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorPamela Fox <pamela.fox@gmail.com>2022-09-04 18:33:50 -0700
committerGitHub <noreply@github.com>2022-09-04 18:33:50 -0700
commita0ad63e70e3682cdf7e87e28091bb54fe12a2d4e (patch)
tree8a2b64598dc2578cdaf9b53a4a984202bba9d066 /Lib/asyncio
parentac1866547243ade5392ed9bc6e7989f4d4346594 (diff)
downloadcpython-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.py5
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: