This commit is contained in:
Vitor Santos Costa
2017-11-11 02:15:59 +00:00
parent 4271f3debe
commit d23f7c149f
13 changed files with 902 additions and 1026 deletions

View File

@@ -271,21 +271,18 @@ bool python_assign(term_t t, PyObject *exp, PyObject *context) {
if (PL_skip_list(t, tail, &len) &&
PL_get_nil(tail)) { // true list
bool o = true;
if (PySequence_Check(exp) && PySequence_Length(exp) == len)
for (i = 0; i < len; i++) {
PyObject *p;
if (!PL_get_list(t, arg, t)) {
PL_reset_term_refs(tail);
o = false;
p = Py_None;
}
if ((p = PySequence_GetItem(exp, i)) == NULL)
p = Py_None;
if (!python_assign(arg, p, context)) {
PL_reset_term_refs(tail);
o = false;
}
}
}