From: Martin Ling Date: Sun, 21 Apr 2013 18:52:09 +0000 (+0100) Subject: python: fix Fraction -> GVariant tuple conversion. X-Git-Tag: dsupstream~91 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1e2bd8af128529d686fb1ac449334a21b74d4fc0;p=libsigrok.git python: fix Fraction -> GVariant tuple conversion. --- diff --git a/bindings/python/sigrok/core/classes.py b/bindings/python/sigrok/core/classes.py index a2b3d809..bd8d3e6c 100644 --- a/bindings/python/sigrok/core/classes.py +++ b/bindings/python/sigrok/core/classes.py @@ -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