Update plugin example to work with recent changes#5601
Conversation
|
Should fix #5570 For the errors, I initially tried adding |
Path::into_pyobject now returns a pathlib.Path object which doesn't work as expected when added to sys.path so revert to string (see PyO3#4925). `impl FromPyObject for PyRefMut` now returns a custom error type (that doesn't impl `std::error::Error`) so map the error back the PyErr to return it (see PyO3#5413).
740267f to
b0c5ba2
Compare
|
Thank you for updating the example, I just tried running it and it works without any issues! 😄 |
I had found that the cargo errors go away if the return type for main is set to fn main() -> PyResult<()> {
/// ...
|
|
I think that makes sense because it'll do the conversion to |
c725183 to
b0c5ba2
Compare
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks for this! I think mapping the errors is fine for now 👍
Path::into_pyobjectnow returns apathlib.Pathobject which doesn't workas expected when added to
sys.pathso revert to string (see #4925).impl FromPyObject for PyRefMutnow returns a custom error type (thatdoesn't impl
std::error::Error) so map the error back toPyErrtoreturn it (see #5413).