##// END OF EJS Templates
rust: Remove use of `py.eval()`...
Simon Sapin -
r47653:c6ceb5f2 default
parent child Browse files
Show More
@@ -14,8 +14,8 b' use std::time::Duration;'
14
14
15 use cpython::{
15 use cpython::{
16 exc, ObjectProtocol, PyBool, PyBytes, PyClone, PyDict, PyErr, PyList,
16 exc, ObjectProtocol, PyBool, PyBytes, PyClone, PyDict, PyErr, PyList,
17 PyObject, PyResult, PyString, PyTuple, Python, PythonObject, ToPyObject,
17 PyObject, PyResult, PySet, PyString, PyTuple, Python, PythonObject,
18 UnsafePyLeaked,
18 ToPyObject, UnsafePyLeaked,
19 };
19 };
20
20
21 use crate::{
21 use crate::{
@@ -175,18 +175,11 b' py_class!(pub class DirstateMap |py| {'
175 let (_, other_parent) =
175 let (_, other_parent) =
176 inner_shared.get_non_normal_other_parent_entries();
176 inner_shared.get_non_normal_other_parent_entries();
177
177
178 let locals = PyDict::new(py);
178 let set = PySet::empty(py)?;
179 locals.set_item(
179 for path in other_parent.iter() {
180 py,
180 set.add(py, PyBytes::new(py, path.as_bytes()))?;
181 "other_parent",
181 }
182 other_parent
182 Ok(set.into_object())
183 .iter()
184 .map(|v| PyBytes::new(py, v.as_bytes()))
185 .collect::<Vec<PyBytes>>()
186 .to_py_object(py),
187 )?;
188
189 py.eval("set(other_parent)", None, Some(&locals))
190 }
183 }
191
184
192 def non_normal_entries(&self) -> PyResult<NonNormalEntries> {
185 def non_normal_entries(&self) -> PyResult<NonNormalEntries> {
General Comments 0
You need to be logged in to leave comments. Login now