From c42698dc85474d00b6c084b19f3603f40415757d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2019 10:04:24 -0500 Subject: [PATCH] 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] * Change into_object() -> into_py() --- misc/wasmtime-py/Cargo.toml | 2 +- misc/wasmtime-py/src/import.rs | 4 ++-- misc/wasmtime-py/src/value.rs | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/misc/wasmtime-py/Cargo.toml b/misc/wasmtime-py/Cargo.toml index 51bfd193f2..fd27069c5e 100644 --- a/misc/wasmtime-py/Cargo.toml +++ b/misc/wasmtime-py/Cargo.toml @@ -27,5 +27,5 @@ region = "2.0.0" wasmparser = "0.37.1" [dependencies.pyo3] -version = "0.7.0-alpha.1" +version = "0.8.0" features = ["extension-module"] diff --git a/misc/wasmtime-py/src/import.rs b/misc/wasmtime-py/src/import.rs index 452c7a38b4..b9f7eb4b6c 100644 --- a/misc/wasmtime-py/src/import.rs +++ b/misc/wasmtime-py/src/import.rs @@ -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"); for i in 0..signature.returns.len() { let val = if result.is_none() { - 0.into_object(py) // FIXME default ??? + 0.into_py(py) // FIXME default ??? } else { if i > 0 { panic!("multiple returns unsupported"); @@ -282,7 +282,7 @@ pub fn into_instance_from_obj( bound_functions.push(BoundPyFunction { name: name.to_string(), - obj: item.into_object(py), + obj: item.into_py(py), }); } else if item.get_type().is_subclass::()? { let wasm_mem = item.cast_as::()?; diff --git a/misc/wasmtime-py/src/value.rs b/misc/wasmtime-py/src/value.rs index 21512189b0..35a45a4167 100644 --- a/misc/wasmtime-py/src/value.rs +++ b/misc/wasmtime-py/src/value.rs @@ -30,22 +30,22 @@ pub fn pyobj_to_value(_: Python, p: &PyAny) -> PyResult { pub fn value_to_pyobj(py: Python, value: Value) -> PyResult { Ok(match value { - Value::I32(i) => i.into_object(py), - Value::U32(i) => i.into_object(py), - Value::I64(i) => i.into_object(py), - Value::U64(i) => i.into_object(py), - Value::F32(i) => i.into_object(py), - Value::F64(i) => i.into_object(py), - Value::String(i) => i.into_object(py), + Value::I32(i) => i.into_py(py), + Value::U32(i) => i.into_py(py), + Value::I64(i) => i.into_py(py), + Value::U64(i) => i.into_py(py), + Value::F32(i) => i.into_py(py), + Value::F64(i) => i.into_py(py), + Value::String(i) => i.into_py(py), }) } pub unsafe fn read_value_from(py: Python, ptr: *mut i64, ty: ir::Type) -> PyObject { match ty { - ir::types::I32 => ptr::read(ptr as *const i32).into_object(py), - ir::types::I64 => ptr::read(ptr as *const i64).into_object(py), - ir::types::F32 => ptr::read(ptr as *const f32).into_object(py), - ir::types::F64 => ptr::read(ptr as *const f64).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_py(py), + ir::types::F32 => ptr::read(ptr as *const f32).into_py(py), + ir::types::F64 => ptr::read(ptr as *const f64).into_py(py), _ => panic!("TODO add PyResult to read_value_from"), } }