summaryrefslogtreecommitdiff
path: root/libvirt-override.c
diff options
context:
space:
mode:
authorPavel Hrdina <phrdina@redhat.com>2018-06-12 07:09:34 +0200
committerPavel Hrdina <phrdina@redhat.com>2018-06-12 10:27:36 +0200
commit0c2d0c9be9d6bfeaca6acf1d11cf5a16f4e229a8 (patch)
treec587be7669dc4d7d65d7e9db5d4c30445dad8ccd /libvirt-override.c
parent181a30867ad83a50e3d09a01dbb9a62a7d2824aa (diff)
downloadlibvirt-python-0c2d0c9be9d6bfeaca6acf1d11cf5a16f4e229a8.tar.gz
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>
Diffstat (limited to 'libvirt-override.c')
-rw-r--r--libvirt-override.c4
1 files changed, 3 insertions, 1 deletions
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);