##// END OF EJS Templates
py3: decode bytes before logging in run-tests.py...
py3: decode bytes before logging in run-tests.py Avoids messages like "Found prerequisite b'diff' at b'/usr/bin/diff'" under Python 3.

File last commit:

r43526:8a6df4e4 default
r43614:b4b11311 stable
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))
}