Skip to content

Commit 9c6b8ec

Browse files
Fix indentation.
1 parent 9146804 commit 9c6b8ec

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

Modules/socketmodule.c

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3342,39 +3342,40 @@ sock_setsockopt(PyObject *self, PyObject *args)
33423342
PyObject *optval;
33433343

33443344
if (!PyArg_ParseTuple(args, "iiO|I:setsockopt",
3345-
&level, &optname, &optval, &optlen)) {
3346-
return NULL;
3345+
&level, &optname, &optval, &optlen))
3346+
{
3347+
return NULL;
33473348
}
33483349

33493350
arglen = PyTuple_Size(args);
33503351
if (arglen == 3 && optval == Py_None) {
33513352
PyErr_Format(PyExc_TypeError,
3352-
"setsockopt() requires 4 arguments when the third argument is None",
3353-
arglen);
3353+
"setsockopt() requires 4 arguments when the third argument is None",
3354+
arglen);
33543355
return NULL;
33553356
}
33563357
if (arglen == 4 && optval != Py_None) {
33573358
PyErr_Format(PyExc_TypeError,
3358-
"setsockopt() only takes 4 arguments when the third argument is None (got %T)",
3359-
optval);
3359+
"setsockopt() only takes 4 arguments when the third argument is None (got %T)",
3360+
optval);
33603361
return NULL;
33613362
}
33623363

33633364
#ifdef AF_VSOCK
33643365
if (s->sock_family == AF_VSOCK) {
33653366
if (!PyIndex_Check(optval)) {
33663367
PyErr_Format(PyExc_TypeError,
3367-
"setsockopt() argument 3 for AF_VSOCK must be an int (got %T)",
3368-
optval);
3369-
}
3368+
"setsockopt() argument 3 for AF_VSOCK must be an int (got %T)",
3369+
optval);
3370+
}
33703371
uint64_t vflag; // Must be set width of 64 bits
33713372
/* setsockopt(level, opt, flag) */
33723373
if (!PyArg_Parse(optval, "K", &vflag)) {
33733374
return NULL;
33743375
}
33753376
// level should always be set to AF_VSOCK
33763377
res = setsockopt(get_sock_fd(s), level, optname,
3377-
(void*)&vflag, sizeof vflag);
3378+
(void*)&vflag, sizeof vflag);
33783379
goto done;
33793380
}
33803381
#endif
@@ -3417,8 +3418,8 @@ sock_setsockopt(PyObject *self, PyObject *args)
34173418
if (buffer.len > INT_MAX) {
34183419
PyBuffer_Release(&buffer);
34193420
PyErr_Format(PyExc_OverflowError,
3420-
"socket option is larger than %i bytes",
3421-
INT_MAX);
3421+
"socket option is larger than %i bytes",
3422+
INT_MAX);
34223423
return NULL;
34233424
}
34243425
res = setsockopt(get_sock_fd(s), level, optname,
@@ -3431,8 +3432,8 @@ sock_setsockopt(PyObject *self, PyObject *args)
34313432
}
34323433

34333434
PyErr_Format(PyExc_TypeError,
3434-
"socket option should be int, bytes-like object or None (got %T)",
3435-
optval);
3435+
"socket option should be int, bytes-like object or None (got %T)",
3436+
optval);
34363437
return NULL;
34373438

34383439
done:

0 commit comments

Comments
 (0)