Skip to content

Commit 2e2a548

Browse files
committed
fix dict key for python special handle
1 parent e9a30b2 commit 2e2a548

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/object/value/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ pub fn py_any_to_teo_value(py: Python<'_>, object: &PyAny) -> PyResult<Value> {
114114
let mut map: IndexMap<String, Value> = IndexMap::new();
115115
for k in dict.keys() {
116116
let k_str: &str = k.extract()?;
117-
map.insert(k_str.to_owned(), py_any_to_teo_value(py, dict.get_item(k)?.unwrap())?);
117+
let fixed_key = if k_str.ends_with("_") { k_str.strip_suffix("_").unwrap().to_owned() } else { k_str.to_owned() };
118+
map.insert(fixed_key, py_any_to_teo_value(py, dict.get_item(k)?.unwrap())?);
118119
}
119120
Ok(Value::Dictionary(map))
120121
} else if object.is_instance_of::<Range>() {

0 commit comments

Comments
 (0)