In virConnectCredCallbackWrapper() we ignore the error case of libvirt_charPtrUnwrap() function so we should also reset the exception. Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- libvirt-override.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libvirt-override.c b/libvirt-override.c index 1c95c18..dac481b 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -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); -- 2.17.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list