]> sigrok.org Git - libsigrok.git/commitdiff
Amend #119 to use vector instead of tuple
authorSoeren Apel <redacted>
Sun, 28 Mar 2021 21:17:17 +0000 (23:17 +0200)
committerSoeren Apel <redacted>
Sun, 28 Mar 2021 21:17:17 +0000 (23:17 +0200)
This way, we don't need to bump glibmm to 2.54, which we otherwise would

bindings/python/sigrok/core/classes.i

index 94913d0f65caa052065a122070d9b48939e0d65a..eb557d0375335f561eb1e05d91f3536c38620c2f 100644 (file)
@@ -344,8 +344,8 @@ Glib::VariantBase python_to_variant_by_key(PyObject *input, const sigrok::Config
         PyObject *numObj = PyTuple_GetItem(input, 0);
         PyObject *denomObj = PyTuple_GetItem(input, 1);
         if ((PyInt_Check(numObj) || PyLong_Check(numObj)) && (PyInt_Check(denomObj) || PyLong_Check(denomObj))) {
-          std::tuple<guint64, guint64> tpl = {PyInt_AsLong(numObj), PyInt_AsLong(denomObj)};
-          return Glib::Variant< std::tuple<guint64,guint64> >::Variant::create(tpl);
+          const std::vector<guint64> v = {(guint64)PyInt_AsLong(numObj), (guint64)PyInt_AsLong(denomObj)};
+          return Glib::Variant< std::vector<guint64> >::create(v);
         }
     }
     throw sigrok::Error(SR_ERR_ARG);