diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-08-01 18:53:01 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-08-01 19:11:39 -0300 |
commit | 028a3af35255beaac4f0bef5e0209a56021ce1fb (patch) | |
tree | 347fda8db36e081a391dd825127bed536729b27e | |
parent | 36e377da2e521207971f6c6aba60e090e384b843 (diff) | |
download | python-schedutils-028a3af35255beaac4f0bef5e0209a56021ce1fb.tar.gz |
Use PyErr_NoMemory when CPU_ALLOC fails
Its the proper function to use when not enough memory is available.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | python-schedutils/schedutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python-schedutils/schedutils.c b/python-schedutils/schedutils.c index c6cc6fd..bdc4117 100644 --- a/python-schedutils/schedutils.c +++ b/python-schedutils/schedutils.c @@ -126,7 +126,7 @@ static PyObject *get_affinity(PyObject *self __unused, PyObject *args) cpus = CPU_ALLOC(max_cpus); if (cpus == NULL) - goto out_error; + return PyErr_NoMemory(); cpusetsize = CPU_ALLOC_SIZE(max_cpus); CPU_ZERO_S(cpusetsize, cpus); @@ -165,7 +165,7 @@ static PyObject *set_affinity(PyObject *self __unused, PyObject *args) cpus = CPU_ALLOC(max_cpus); if (cpus == NULL) - goto out_error; + return PyErr_NoMemory(); cpusetsize = CPU_ALLOC_SIZE(max_cpus); CPU_ZERO_S(cpusetsize, cpus); |