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:
dependabot-preview[bot]
2019-09-10 10:04:24 -05:00
committed by Yury Delendik
parent 1497825173
commit c42698dc85
3 changed files with 14 additions and 14 deletions

View File

@@ -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"]

View File

@@ -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::<Memory>()? {
let wasm_mem = item.cast_as::<Memory>()?;

View File

@@ -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> {
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"),
}
}