Skip to content

Commit

Permalink
Python: Don't panic when unable to convert an interpreter data type t…
Browse files Browse the repository at this point in the history
…o Python

Print a warning and return None instead
  • Loading branch information
tronical committed Mar 6, 2024
1 parent b075fa8 commit b87cd69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/python/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}
Expand Down

0 comments on commit b87cd69

Please sign in to comment.