diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2015-01-03 09:09:01 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2015-01-03 09:09:01 +0100 |
commit | a09687d699ed9bc65a8b9c3c8c2bee5e72cff2c4 (patch) | |
tree | 4f3f75630718f4297e167131beac2b6cccea8216 | |
parent | e05e0a81f1a8165a5002bbca20881e9627607db5 (diff) | |
download | psutil-a09687d699ed9bc65a8b9c3c8c2bee5e72cff2c4.tar.gz |
minor refactoring
-rw-r--r-- | psutil/_psutil_bsd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c index 70dcc2db..ab3682b8 100644 --- a/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c @@ -2117,14 +2117,12 @@ psutil_proc_cpu_affinity_set(PyObject *self, PyObject *args) PyObject *py_cpu_set; PyObject *py_cpu_seq = NULL; - if (!PyArg_ParseTuple(args, "lO", &pid, &py_cpu_set)) { - goto error; - } + if (!PyArg_ParseTuple(args, "lO", &pid, &py_cpu_set)) + return NULL; py_cpu_seq = PySequence_Fast(py_cpu_set, "expected a sequence or integer"); - if (!py_cpu_seq) { - goto error; - } + if (!py_cpu_seq) + return NULL; seq_len = PySequence_Fast_GET_SIZE(py_cpu_seq); // calculate the mask |