Skip to content
Snippets Groups Projects
Verified Commit 6f3dc0b1 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

fix: error conversion into PyObject

parent e825ec04
No related branches found
No related tags found
No related merge requests found
Pipeline #3999 passed
use pyo3::{exceptions::PyException, prelude::*, types::PyBytes};
use pyo3::{conversion::IntoPy, exceptions::PyException, prelude::*, types::PyBytes};
use crate::{
error::Error,
gb::{GameBoy as GameBoyBase, GameBoyMode},
info::Info,
pad::PadKey,
......@@ -180,3 +181,9 @@ fn boytacean(_py: Python, module: &PyModule) -> PyResult<()> {
module.add("LCD_CYCLES", GameBoyBase::LCD_CYCLES)?;
Ok(())
}
impl IntoPy<PyObject> for Error {
fn into_py(self, py: Python<'_>) -> PyObject {
self.to_string().into_py(py)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment