mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-02 04:21:59 +03:00
Improve error output when use getTime with a nonzero flags.
When give a nonzero flags to getTime, c_retval will get -1 and goto cleanup. But py_retval still is NULL, so set py_retval = VIR_PY_NONE. This will make the output message more correct. Signed-off-by: Luyao Huang <lhuang@redhat.com>
This commit is contained in:
committed by
Pavel Hrdina
parent
8feae56ce4
commit
d8b7aa4b18
@ -7757,8 +7757,10 @@ libvirt_virDomainGetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
c_retval = virDomainGetTime(domain, &seconds, &nseconds, flags);
|
||||
LIBVIRT_END_ALLOW_THREADS;
|
||||
|
||||
if (c_retval < 0)
|
||||
if (c_retval < 0) {
|
||||
py_retval = VIR_PY_NONE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(pyobj_seconds = libvirt_longlongWrap(seconds)) ||
|
||||
PyDict_SetItemString(dict, "seconds", pyobj_seconds) < 0)
|
||||
|
Reference in New Issue
Block a user