Categories
Mastering Development

How do I unmarshal a PyCodeObject using PyO3?

I am reading .pyc files, and need to be able to unmarshal code objects. When I try to downcast the unmarshalled PyAny to PyCodeObject, I get the following error message: error[E0277]: the trait bound `pyo3::ffi::code::PyCodeObject: pyo3::type_object::PyTypeInfo` is not satisfied –> src/lib.rs:179:47 | 179 | let code = *(loads(py, &code_buffer)?.downcast::<PyCodeObject>()?); | ^^^^^^^^ the trait `pyo3::type_object::PyTypeInfo` is […]

Categories
Mastering Development

How do I unmarshal a PyCodeObject using PyO3?

I am reading .pyc files, and need to be able to unmarshal code objects. When I try to downcast the unmarshalled PyAny to PyCodeObject, I get the following error message: error[E0277]: the trait bound `pyo3::ffi::code::PyCodeObject: pyo3::type_object::PyTypeInfo` is not satisfied –> src/lib.rs:179:47 | 179 | let code = *(loads(py, &code_buffer)?.downcast::<PyCodeObject>()?); | ^^^^^^^^ the trait `pyo3::type_object::PyTypeInfo` is […]