mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119)
This commit is contained in:
parent
4bfebc6301
commit
1d1d3e9db8
8 changed files with 67 additions and 19 deletions
|
@ -990,7 +990,9 @@ parse_address(PyObject *obj, SOCKADDR *Address, int Length)
|
|||
((SOCKADDR_IN*)Address)->sin_port = htons(Port);
|
||||
return Length;
|
||||
}
|
||||
else if (PyArg_ParseTuple(obj, "uHkk", &Host, &Port, &FlowInfo, &ScopeId))
|
||||
else if (PyArg_ParseTuple(obj,
|
||||
"uHkk;ConnectEx(): illegal address_as_bytes "
|
||||
"argument", &Host, &Port, &FlowInfo, &ScopeId))
|
||||
{
|
||||
PyErr_Clear();
|
||||
Address->sa_family = AF_INET6;
|
||||
|
@ -1024,8 +1026,11 @@ Overlapped_ConnectEx(OverlappedObject *self, PyObject *args)
|
|||
BOOL ret;
|
||||
DWORD err;
|
||||
|
||||
if (!PyArg_ParseTuple(args, F_HANDLE "O", &ConnectSocket, &AddressObj))
|
||||
if (!PyArg_ParseTuple(args, F_HANDLE "O!:ConnectEx",
|
||||
&ConnectSocket, &PyTuple_Type, &AddressObj))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (self->type != TYPE_NONE) {
|
||||
PyErr_SetString(PyExc_ValueError, "operation already attempted");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue