Skip to content

Commit d7d77cb

Browse files
fix: update to match new API
1 parent 5e4b9d2 commit d7d77cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

eyre/tests/test_pyo3.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![cfg(feature = "pyo3")]
22

3+
use std::ffi::CString;
4+
35
use pyo3::prelude::*;
46

57
use eyre::{bail, Result, WrapErr};
@@ -26,8 +28,9 @@ fn test_pyo3_exception_contents() {
2628
let pyerr = PyErr::from(err);
2729

2830
Python::with_gil(|py| {
29-
let locals = [("err", pyerr)].into_py_dict(py);
30-
let pyerr = py.run("raise err", None, Some(locals)).unwrap_err();
31+
let locals = [("err", pyerr)].into_py_dict(py).unwrap();
32+
let raise_err = CString::new("raise err").unwrap();
33+
let pyerr = py.run(&raise_err, None, Some(&locals)).unwrap_err();
3134
assert_eq!(pyerr.value(py).to_string(), expected_contents);
3235
})
3336
}

0 commit comments

Comments
 (0)