Update pyo3 requirement from 0.7.0-alpha.1 to 0.8.0 (#324)
* Update pyo3 requirement from 0.7.0-alpha.1 to 0.8.0 Updates the requirements on [pyo3](https://github.com/pyo3/pyo3) to permit the latest version. - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/master/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.7.0-alpha.1...v0.8.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Change into_object() -> into_py()
This commit is contained in:
committed by
Yury Delendik
parent
1497825173
commit
c42698dc85
@@ -27,5 +27,5 @@ region = "2.0.0"
|
|||||||
wasmparser = "0.37.1"
|
wasmparser = "0.37.1"
|
||||||
|
|
||||||
[dependencies.pyo3]
|
[dependencies.pyo3]
|
||||||
version = "0.7.0-alpha.1"
|
version = "0.8.0"
|
||||||
features = ["extension-module"]
|
features = ["extension-module"]
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ unsafe extern "C" fn stub_fn(vmctx: *mut VMContext, call_id: u32, values_vec: *m
|
|||||||
let result = obj.call(py, PyTuple::new(py, args), None).expect("result");
|
let result = obj.call(py, PyTuple::new(py, args), None).expect("result");
|
||||||
for i in 0..signature.returns.len() {
|
for i in 0..signature.returns.len() {
|
||||||
let val = if result.is_none() {
|
let val = if result.is_none() {
|
||||||
0.into_object(py) // FIXME default ???
|
0.into_py(py) // FIXME default ???
|
||||||
} else {
|
} else {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
panic!("multiple returns unsupported");
|
panic!("multiple returns unsupported");
|
||||||
@@ -282,7 +282,7 @@ pub fn into_instance_from_obj(
|
|||||||
|
|
||||||
bound_functions.push(BoundPyFunction {
|
bound_functions.push(BoundPyFunction {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
obj: item.into_object(py),
|
obj: item.into_py(py),
|
||||||
});
|
});
|
||||||
} else if item.get_type().is_subclass::<Memory>()? {
|
} else if item.get_type().is_subclass::<Memory>()? {
|
||||||
let wasm_mem = item.cast_as::<Memory>()?;
|
let wasm_mem = item.cast_as::<Memory>()?;
|
||||||
|
|||||||
@@ -30,22 +30,22 @@ pub fn pyobj_to_value(_: Python, p: &PyAny) -> PyResult<Value> {
|
|||||||
|
|
||||||
pub fn value_to_pyobj(py: Python, value: Value) -> PyResult<PyObject> {
|
pub fn value_to_pyobj(py: Python, value: Value) -> PyResult<PyObject> {
|
||||||
Ok(match value {
|
Ok(match value {
|
||||||
Value::I32(i) => i.into_object(py),
|
Value::I32(i) => i.into_py(py),
|
||||||
Value::U32(i) => i.into_object(py),
|
Value::U32(i) => i.into_py(py),
|
||||||
Value::I64(i) => i.into_object(py),
|
Value::I64(i) => i.into_py(py),
|
||||||
Value::U64(i) => i.into_object(py),
|
Value::U64(i) => i.into_py(py),
|
||||||
Value::F32(i) => i.into_object(py),
|
Value::F32(i) => i.into_py(py),
|
||||||
Value::F64(i) => i.into_object(py),
|
Value::F64(i) => i.into_py(py),
|
||||||
Value::String(i) => i.into_object(py),
|
Value::String(i) => i.into_py(py),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn read_value_from(py: Python, ptr: *mut i64, ty: ir::Type) -> PyObject {
|
pub unsafe fn read_value_from(py: Python, ptr: *mut i64, ty: ir::Type) -> PyObject {
|
||||||
match ty {
|
match ty {
|
||||||
ir::types::I32 => ptr::read(ptr as *const i32).into_object(py),
|
ir::types::I32 => ptr::read(ptr as *const i32).into_py(py),
|
||||||
ir::types::I64 => ptr::read(ptr as *const i64).into_object(py),
|
ir::types::I64 => ptr::read(ptr as *const i64).into_py(py),
|
||||||
ir::types::F32 => ptr::read(ptr as *const f32).into_object(py),
|
ir::types::F32 => ptr::read(ptr as *const f32).into_py(py),
|
||||||
ir::types::F64 => ptr::read(ptr as *const f64).into_object(py),
|
ir::types::F64 => ptr::read(ptr as *const f64).into_py(py),
|
||||||
_ => panic!("TODO add PyResult to read_value_from"),
|
_ => panic!("TODO add PyResult to read_value_from"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user