summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2015-01-03 09:09:01 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2015-01-03 09:09:01 +0100
commita09687d699ed9bc65a8b9c3c8c2bee5e72cff2c4 (patch)
tree4f3f75630718f4297e167131beac2b6cccea8216
parente05e0a81f1a8165a5002bbca20881e9627607db5 (diff)
downloadpsutil-a09687d699ed9bc65a8b9c3c8c2bee5e72cff2c4.tar.gz
minor refactoring
-rw-r--r--psutil/_psutil_bsd.c10
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