mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
Use new_list when constructing multiplied list.
This commit is contained in:
1 parent
bbe333d6c7
commit
950dbd1a77
1 file changed
+1
-6
@@ -252,12 +252,7 @@ fn list_mul(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
new_elements.extend(elements.clone());
|
||||
}
|
||||
|
||||
Ok(PyObject::new(
|
||||
PyObjectKind::Sequence {
|
||||
elements: new_elements,
|
||||
},
|
||||
vm.ctx.list_type(),
|
||||
))
|
||||
Ok(vm.ctx.new_list(new_elements))
|
||||
}
|
||||
|
||||
pub fn init(context: &PyContext) {
|
||||
|
||||
Reference in new issue
Block a user