Skip to content

Commit 1cda87a

Browse files
Merge pull request RustPython#752 from RustPython/more_dict_cleanup
More dict cleanup
2 parents 14d3aab + c644176 commit 1cda87a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

vm/src/stdlib/json.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ pub fn de_pyobject(vm: &VirtualMachine, s: &str) -> PyResult {
199199
de.deserialize(&mut serde_json::Deserializer::from_str(s))
200200
.map_err(|err| {
201201
let json_decode_error = vm
202-
.sys_module
203-
.get_item("modules")
202+
.get_attribute(vm.sys_module.clone(), "modules")
204203
.unwrap()
205204
.get_item("json")
206205
.unwrap()

vm/src/vm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,11 @@ impl VirtualMachine {
451451
// Do we support `**kwargs` ?
452452
let kwargs = match code_object.varkeywords {
453453
bytecode::Varargs::Named(ref kwargs_name) => {
454-
let d = self.ctx.new_dict().into_object();
455-
locals.set_item(&self.ctx, kwargs_name, d.clone());
454+
let d = self.ctx.new_dict();
455+
locals.set_item(&self.ctx, kwargs_name, d.as_object().clone());
456456
Some(d)
457457
}
458-
bytecode::Varargs::Unnamed => Some(self.ctx.new_dict().into_object()),
458+
bytecode::Varargs::Unnamed => Some(self.ctx.new_dict()),
459459
bytecode::Varargs::None => None,
460460
};
461461

0 commit comments

Comments
 (0)