From 0c2d0c9be9d6bfeaca6acf1d11cf5a16f4e229a8 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Tue, 12 Jun 2018 07:09:34 +0200 Subject: libvirt-override: Reset exception if the error is ignored MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In virConnectCredCallbackWrapper() we ignore the error case of libvirt_charPtrUnwrap() function so we should also reset the exception. Reviewed-by: Ján Tomko Signed-off-by: Pavel Hrdina --- libvirt-override.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libvirt-override.c') 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); -- cgit v1.2.1