mirror of
https://github.com/python/cpython.git
synced 2026-02-14 11:21:01 +00:00
gh-144493: Improve error message in _overlapped.BindLocal() (#144495)
Replace a confusing error message with one that actually explains what the error is in `_overlapped.BindLocal()`. Fixes: https://github.com/python/cpython/issues/144493
This commit is contained in:
parent
957f9fe162
commit
56590f820e
2 changed files with 2 additions and 1 deletions
|
|
@ -0,0 +1 @@
|
|||
Improve an exception error message in ``_overlapped.BindLocal()`` that is raised when :meth:`asyncio.loop.sock_connect` is called on a :class:`asyncio.ProactorEventLoop` with a socket that has an invalid address family.
|
||||
|
|
@ -559,7 +559,7 @@ _overlapped_BindLocal_impl(PyObject *module, HANDLE Socket, int Family)
|
|||
ret = bind((SOCKET)Socket, (SOCKADDR*)&addr, sizeof(addr))
|
||||
!= SOCKET_ERROR;
|
||||
} else {
|
||||
PyErr_SetString(PyExc_ValueError, "expected tuple of length 2 or 4");
|
||||
PyErr_SetString(PyExc_ValueError, "Only AF_INET and AF_INET6 families are supported");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue