]> sigrok.org Git - libsigrok.git/commitdiff
python: fix Fraction -> GVariant tuple conversion.
authorMartin Ling <redacted>
Sun, 21 Apr 2013 18:52:09 +0000 (19:52 +0100)
committerMartin Ling <redacted>
Sun, 21 Apr 2013 18:52:09 +0000 (19:52 +0100)
bindings/python/sigrok/core/classes.py

index a2b3d809de0c257eae9e6c88f1ffa84ebf62b02e..bd8d3e6cc3ead6d6f3a26fd897987c20e01db188 100644 (file)
@@ -69,8 +69,10 @@ def python_to_gvariant(value):
         return g_variant_new_string(value)
     if isinstance(value, Fraction):
         array = new_gvariant_ptr_array(2)
-        gvariant_ptr_array_setitem(array, 0, value.numerator)
-        gvariant_ptr_array_setitem(array, 1, value.denominator)
+        gvariant_ptr_array_setitem(array, 0,
+            g_variant_new_uint64(value.numerator))
+        gvariant_ptr_array_setitem(array, 1,
+            g_variant_new_uint64(value.denominator))
         result = g_variant_new_tuple(array, 2)
         delete_gvariant_ptr_array(array)
         return result