From: Martin Ling Date: Sun, 14 Sep 2014 03:53:06 +0000 (+0100) Subject: python: fix conversion to string variants. X-Git-Tag: libsigrok-0.4.0~1002 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f90ed2d1afbb22a90e26b92a34ae55215c1685ca;p=libsigrok.git python: fix conversion to string variants. --- diff --git a/bindings/python/sigrok/core/classes.i b/bindings/python/sigrok/core/classes.i index a01d18af..be3b404a 100644 --- a/bindings/python/sigrok/core/classes.i +++ b/bindings/python/sigrok/core/classes.i @@ -294,7 +294,7 @@ Glib::VariantBase python_to_variant_by_key(PyObject *input, const sigrok::Config if (type == SR_T_UINT64 && PyLong_Check(input)) return Glib::Variant::create(PyLong_AsLong(input)); else if (type == SR_T_STRING && PyString_Check(input)) - return Glib::Variant::create(PyString_AsString(input)); + return Glib::Variant::create(PyString_AsString(input)); else if (type == SR_T_BOOL && PyBool_Check(input)) return Glib::Variant::create(input == Py_True); else if (type == SR_T_FLOAT && PyFloat_Check(input)) @@ -316,7 +316,7 @@ Glib::VariantBase python_to_variant_by_option(PyObject *input, if (type == G_VARIANT_TYPE_UINT64 && PyLong_Check(input)) return Glib::Variant::create(PyLong_AsLong(input)); else if (type == G_VARIANT_TYPE_STRING && PyString_Check(input)) - return Glib::Variant::create(PyString_AsString(input)); + return Glib::Variant::create(PyString_AsString(input)); else if (type == G_VARIANT_TYPE_BOOLEAN && PyBool_Check(input)) return Glib::Variant::create(input == Py_True); else if (type == G_VARIANT_TYPE_DOUBLE && PyFloat_Check(input))