mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
socket.sendto(): exit directly after setting the error
Dummy change to avoid a false positive with the Clang Static Analyzer.
This commit is contained in:
parent
9a2261a372
commit
77af172914
1 changed files with 5 additions and 4 deletions
|
@ -2782,6 +2782,7 @@ sock_sendto(PySocketSockObject *s, PyObject *args)
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"sendto() takes 2 or 3 arguments (%d given)",
|
"sendto() takes 2 or 3 arguments (%d given)",
|
||||||
arglen);
|
arglen);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
if (PyErr_Occurred())
|
if (PyErr_Occurred())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -3144,7 +3145,7 @@ socket_gethostname(PyObject *self, PyObject *unused)
|
||||||
}
|
}
|
||||||
return PyErr_SetExcFromWindowsErr(PyExc_WindowsError, GetLastError());
|
return PyErr_SetExcFromWindowsErr(PyExc_WindowsError, GetLastError());
|
||||||
}
|
}
|
||||||
return PyUnicode_FromUnicode(buf, size);
|
return PyUnicode_FromUnicode(buf, size);
|
||||||
#else
|
#else
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int res;
|
int res;
|
||||||
|
@ -4038,7 +4039,7 @@ socket_inet_ntop(PyObject *self, PyObject *args)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
|
socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
|
||||||
{
|
{
|
||||||
static char* kwnames[] = {"host", "port", "family", "type", "proto",
|
static char* kwnames[] = {"host", "port", "family", "type", "proto",
|
||||||
"flags", 0};
|
"flags", 0};
|
||||||
struct addrinfo hints, *res;
|
struct addrinfo hints, *res;
|
||||||
struct addrinfo *res0 = NULL;
|
struct addrinfo *res0 = NULL;
|
||||||
|
@ -4053,7 +4054,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
|
||||||
|
|
||||||
family = socktype = protocol = flags = 0;
|
family = socktype = protocol = flags = 0;
|
||||||
family = AF_UNSPEC;
|
family = AF_UNSPEC;
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iiii:getaddrinfo",
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iiii:getaddrinfo",
|
||||||
kwnames, &hobj, &pobj, &family, &socktype,
|
kwnames, &hobj, &pobj, &family, &socktype,
|
||||||
&protocol, &flags)) {
|
&protocol, &flags)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -4289,7 +4290,7 @@ socket_if_nameindex(PyObject *self, PyObject *arg)
|
||||||
PyObject *list;
|
PyObject *list;
|
||||||
int i;
|
int i;
|
||||||
struct if_nameindex *ni;
|
struct if_nameindex *ni;
|
||||||
|
|
||||||
ni = if_nameindex();
|
ni = if_nameindex();
|
||||||
if (ni == NULL) {
|
if (ni == NULL) {
|
||||||
PyErr_SetFromErrno(socket_error);
|
PyErr_SetFromErrno(socket_error);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue