diff options
-rw-r--r-- | libvirt-override.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libvirt-override.c b/libvirt-override.c index 768144a..bb1d881 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -1840,7 +1840,8 @@ libvirt_virConnectOpenAuth(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { auth.credtype[i] = (int)PyLong_AsLong(val); } } - auth.cb = pycredcb ? virConnectCredCallbackWrapper : NULL; + if (pycredcb && pycredcb != Py_None) + auth.cb = virConnectCredCallbackWrapper; auth.cbdata = pyauth; LIBVIRT_BEGIN_ALLOW_THREADS; |