Skip to content

Commit 40d4551

Browse files
committed
Address core dev feedback: use TimeoutError instead of OSError
Core developer suggested TimeoutError is more appropriate when empty exceptions list indicates all connections exceeded their timeout.
1 parent f37d9e3 commit 40d4551

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/asyncio/base_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,8 @@ async def create_connection(
11711171
raise OSError('Multiple exceptions: {}'.format(
11721172
', '.join(str(exc) for exc in exceptions)))
11731173
else:
1174-
# No exceptions were collected, raise a generic connection error
1175-
raise OSError('create_connection failed')
1174+
# No exceptions were collected, raise a timeout error
1175+
raise TimeoutError('create_connection failed')
11761176
finally:
11771177
exceptions = None
11781178

0 commit comments

Comments
 (0)