Merge pull request #1352 from HyeockJinKim/issue1351

Clone other to prevent borrow error
This commit is contained in:
Noah
2019-09-07 22:59:06 -05:00
committed by GitHub

View File

@@ -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())