##// END OF EJS Templates
rust-cpython: make `NonNormalEntires` iterable to fix `fsmonitor` (issue6276)...
rust-cpython: make `NonNormalEntires` iterable to fix `fsmonitor` (issue6276) This fixes a bug when using `fsmonitor` that tries to iterate on the non normal set, by adding a shared iterator interface. Differential Revision: https://phab.mercurial-scm.org/D8143

File last commit:

r43526:8a6df4e4 default
r44899:5f9de600 default
Show More
utils.rs
13 lines | 538 B | application/rls-services+xml | RustLexer
use cpython::{PyDict, PyObject, PyResult, PyTuple, Python};
#[allow(unused)]
pub fn print_python_trace(py: Python) -> PyResult<PyObject> {
eprintln!("===============================");
eprintln!("Printing Python stack from Rust");
eprintln!("===============================");
let traceback = py.import("traceback")?;
let sys = py.import("sys")?;
let kwargs = PyDict::new(py);
kwargs.set_item(py, "file", sys.get(py, "stderr")?)?;
traceback.call(py, "print_stack", PyTuple::new(py, &[]), Some(&kwargs))
}