Python: Don't panic when unable to convert an interpreter data type to Python

Print a warning and return None instead
This commit is contained in:
Simon Hausmann 2024-03-06 17:18:13 +01:00
parent b075fa8acd
commit b87cd69f47

View file

@ -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)
}
}
}
}