mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Merge pull request #1352 from HyeockJinKim/issue1351
Clone other to prevent borrow error
This commit is contained in:
@@ -146,9 +146,8 @@ impl PyListRef {
|
||||
|
||||
fn iadd(self, other: PyObjectRef, vm: &VirtualMachine) -> PyResult {
|
||||
if objtype::isinstance(&other, &vm.ctx.list_type()) {
|
||||
self.elements
|
||||
.borrow_mut()
|
||||
.extend_from_slice(&get_elements_list(&other));
|
||||
let e = get_elements_list(&other).clone();
|
||||
self.elements.borrow_mut().extend_from_slice(&e);
|
||||
Ok(self.into_object())
|
||||
} else {
|
||||
Ok(vm.ctx.not_implemented())
|
||||
|
||||
Reference in New Issue
Block a user