1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-03 08:21:58 +03:00

override: GetCPUModelNames should return None on failure

Right now, on failure, libvirt.py doesn't raise an exception and just
returns -1 to the user.
This commit is contained in:
Cole Robinson
2014-03-20 13:27:12 -04:00
parent 71fda98981
commit 33e39093ca

View File

@ -2326,7 +2326,7 @@ libvirt_virConnectGetCPUModelNames(PyObject *self ATTRIBUTE_UNUSED,
LIBVIRT_END_ALLOW_THREADS;
if (c_retval == -1)
return VIR_PY_INT_FAIL;
return VIR_PY_NONE;
if ((rv = PyList_New(c_retval)) == NULL)
goto error;
@ -2350,7 +2350,7 @@ done:
error:
Py_XDECREF(rv);
rv = VIR_PY_INT_FAIL;
rv = VIR_PY_NONE;
goto done;
}
#endif /* LIBVIR_CHECK_VERSION(1, 1, 3) */