Skip to content
Snippets Groups Projects
Commit 1215dc47 authored by Krzysztof Blazewicz's avatar Krzysztof Blazewicz Committed by Damien George
Browse files

py/runtime.c: Remove optimization of '*a,=b', it caused a bug.

*a, = b should always make a copy of b, instead, before this patch
if b was a list it would copy only a reference to it.
parent 88ffe0d5
No related branches found
No related tags found
No related merge requests found
......@@ -854,11 +854,6 @@ void mp_unpack_ex(mp_obj_t seq_in, size_t num_in, mp_obj_t *items) {
if (MP_OBJ_IS_TYPE(seq_in, &mp_type_tuple)) {
mp_obj_tuple_get(seq_in, &seq_len, &seq_items);
} else {
if (num_left == 0 && num_right == 0) {
// *a, = b # sets a to b if b is a list
items[0] = seq_in;
return;
}
mp_obj_list_get(seq_in, &seq_len, &seq_items);
}
if (seq_len < num_left + num_right) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment