From 1e2bd8af128529d686fb1ac449334a21b74d4fc0 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sun, 21 Apr 2013 19:52:09 +0100 Subject: [PATCH] python: fix Fraction -> GVariant tuple conversion. --- bindings/python/sigrok/core/classes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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