From fae0b529ba1eae1cfe8b6704faa95764a55567e2 Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Fri, 21 Jul 2017 15:53:21 +0200 Subject: [PATCH] Fix Python setTable() function --- Engine/typesystem_engine.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/typesystem_engine.xml b/Engine/typesystem_engine.xml index b9780309b7..8201088a43 100644 --- a/Engine/typesystem_engine.xml +++ b/Engine/typesystem_engine.xml @@ -1497,7 +1497,7 @@ PyObject* subList = PyList_GET_ITEM(%PYARG_1,i); - if (!subList) { + if (!subList || !PyList_Check(subList)) { PyErr_SetString(PyExc_TypeError, "table must be a list of list objects."); return 0; } @@ -1506,7 +1506,7 @@ for (int j = 0; j < subSize; ++j) { PyObject* pyString = PyList_GET_ITEM(subList,j); - if ( PyUnicode_Check(pyString) ) { + if ( PyString_Check(pyString) || PyUnicode_Check(pyString) ) { PyObject* utf8pyobj = PyUnicode_AsUTF8String(pyString); // newRef if (utf8pyobj) {