This commit is contained in:
Vitor Santos Costa
2016-08-22 04:01:38 +01:00
parent e50d722e66
commit ba730273e7
7 changed files with 86 additions and 59 deletions

View File

@@ -951,13 +951,15 @@ PyObject *compound_to_pytree(term_t t, functor_t fun) {
// this should never happen
return term_to_python( t, false);
} else {
#if PY_MAJOR_VERSION >= 3
const char *s;
if (!(s = PL_atom_chars(name)))
return NULL;
#if PY_MAJOR_VERSION >= 3
return term_to_nametuple(s, arity, t);
#else
PyObject *c, *o1;
term_t tleft;
int i;
PyObject *c, *o1;
o = PyTuple_New(arity);
tleft = PL_new_term_ref();
for (i = 0; i < arity; i++) {