From b87cd69f479bd1cbc22e3568218d95c5cc8ed66d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 6 Mar 2024 17:18:13 +0100 Subject: [PATCH] Python: Don't panic when unable to convert an interpreter data type to Python Print a warning and return None instead --- api/python/value.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/python/value.rs b/api/python/value.rs index 311b26cec20..d56b7029f19 100644 --- a/api/python/value.rs +++ b/api/python/value.rs @@ -49,7 +49,10 @@ impl<'a> ToPyObject for PyValueRef<'a> { slint_interpreter::Value::Brush(brush) => { crate::brush::PyBrush::from(brush.clone()).into_py(py) } - _ => todo!(), + v @ _ => { + eprintln!("Python: conversion from slint to python needed for {:#?} and not implemented yet", v); + ().into_py(py) + } } } }