diff options
author | 2020-05-18 08:21:30 +0200 | |
---|---|---|
committer | 2020-05-17 23:21:30 -0700 | |
commit | 442634c42fcaf31c636f693951a97734042c3e7b (patch) | |
tree | df3dc97f33eea99bf18898e037c363f0e8a04b06 /Modules | |
parent | bpo-31033: Improve the traceback for cancelled asyncio tasks (GH-19951) (diff) | |
download | cpython-442634c42fcaf31c636f693951a97734042c3e7b.tar.gz cpython-442634c42fcaf31c636f693951a97734042c3e7b.tar.bz2 cpython-442634c42fcaf31c636f693951a97734042c3e7b.zip |
bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)
Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd.
Change the raised exception so users are not fooled to think it comes from Windows API.
Automerge-Triggered-By: @njsmith
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/overlapped.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/overlapped.c b/Modules/overlapped.c index a16797c47b5..df6282cba81 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -670,7 +670,6 @@ make_ipv4_addr(const struct sockaddr_in *addr) return PyUnicode_FromString(buf); } -#ifdef ENABLE_IPV6 /* Convert IPv6 sockaddr to a Python str. */ static PyObject * @@ -683,7 +682,6 @@ make_ipv6_addr(const struct sockaddr_in6 *addr) } return PyUnicode_FromString(buf); } -#endif static PyObject* unparse_address(LPSOCKADDR Address, DWORD Length) @@ -701,7 +699,6 @@ unparse_address(LPSOCKADDR Address, DWORD Length) } return ret; } -#ifdef ENABLE_IPV6 case AF_INET6: { const struct sockaddr_in6 *a = (const struct sockaddr_in6 *)Address; PyObject *addrobj = make_ipv6_addr(a); @@ -716,9 +713,9 @@ unparse_address(LPSOCKADDR Address, DWORD Length) } return ret; } -#endif /* ENABLE_IPV6 */ default: { - return SetFromWindowsErr(ERROR_INVALID_PARAMETER); + PyErr_SetString(PyExc_ValueError, "recvfrom returned unsupported address family"); + return NULL; } } } |