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

libvirt-override: Reset exception if the error is ignored

In virConnectCredCallbackWrapper() we ignore the error case of
libvirt_charPtrUnwrap() function so we should also reset the exception.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina
2018-06-12 07:09:34 +02:00
parent 181a30867a
commit 0c2d0c9be9

View File

@ -1918,8 +1918,10 @@ virConnectCredCallbackWrapper(virConnectCredentialPtr cred,
char *result = NULL;
pycreditem = PyTuple_GetItem(pycred, i);
pyresult = PyList_GetItem(pycreditem, 4);
if (pyresult != Py_None)
if (pyresult != Py_None) {
libvirt_charPtrUnwrap(pyresult, &result);
PyErr_Clear();
}
if (result != NULL) {
cred[i].result = result;
cred[i].resultlen = strlen(result);