[python PATCH 3/4] libvirt-override: Reset exception if the error is ignored

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux