diff options
-rw-r--r-- | libvirt-utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libvirt-utils.c b/libvirt-utils.c index d8ff11d..a964779 100644 --- a/libvirt-utils.c +++ b/libvirt-utils.c @@ -408,10 +408,12 @@ virPyDictToTypedParamOne(virTypedParameterPtr *params, type = VIR_TYPED_PARAM_BOOLEAN; } else if (PyLong_Check(value)) { unsigned long long ull = PyLong_AsUnsignedLongLong(value); - if (ull == (unsigned long long) -1 && PyErr_Occurred()) + if (ull == (unsigned long long) -1 && PyErr_Occurred()) { type = VIR_TYPED_PARAM_LLONG; - else + PyErr_Clear(); + } else { type = VIR_TYPED_PARAM_ULLONG; + } } else if (PyFloat_Check(value)) { type = VIR_TYPED_PARAM_DOUBLE; } |