X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=bindings%2Fpython%2Fsigrok%2Fcore%2Fclasses.i;fp=bindings%2Fpython%2Fsigrok%2Fcore%2Fclasses.i;h=8bccae1d5271aa98ebadf15baab4f07bcb3fa55d;hp=eb557d0375335f561eb1e05d91f3536c38620c2f;hb=0db1b189bee3ffe5c6ea39d7ca2e62715856b538;hpb=f806de1864167feed30952f1ab65497b8ee4152a diff --git a/bindings/python/sigrok/core/classes.i b/bindings/python/sigrok/core/classes.i index eb557d03..8bccae1d 100644 --- a/bindings/python/sigrok/core/classes.i +++ b/bindings/python/sigrok/core/classes.i @@ -340,6 +340,8 @@ Glib::VariantBase python_to_variant_by_key(PyObject *input, const sigrok::Config return Glib::Variant::create(PyFloat_AsDouble(input)); else if (type == SR_T_INT32 && PyInt_Check(input)) return Glib::Variant::create(PyInt_AsLong(input)); + else if (type == SR_T_UINT32 && PyInt_Check(input)) + return Glib::Variant::create(PyInt_AsLong(input)); else if ((type == SR_T_RATIONAL_VOLT) && PyTuple_Check(input) && (PyTuple_Size(input) == 2)) { PyObject *numObj = PyTuple_GetItem(input, 0); PyObject *denomObj = PyTuple_GetItem(input, 1); @@ -369,6 +371,8 @@ Glib::VariantBase python_to_variant_by_option(PyObject *input, return Glib::Variant::create(PyFloat_AsDouble(input)); else if (type == G_VARIANT_TYPE_INT32 && PyInt_Check(input)) return Glib::Variant::create(PyInt_AsLong(input)); + else if (type == G_VARIANT_TYPE_UINT32 && PyInt_Check(input)) + return Glib::Variant::create(PyInt_AsLong(input)); else throw sigrok::Error(SR_ERR_ARG); }