mirror of https://github.com/pyodide/pyodide.git
Fallback to raw object when converting a sequence fails
This happens with Pandas data frames.
This commit is contained in:
parent
420bdcda7e
commit
8ee2dec166
|
@ -114,7 +114,9 @@ val pythonToJs(PyObject *x) {
|
|||
for (size_t i = 0; i < length; ++i) {
|
||||
PyObject *item = PySequence_GetItem(x, i);
|
||||
if (item == NULL) {
|
||||
return pythonExcToJs();
|
||||
// If something goes wrong converting the sequence, fallback to the Python proxy
|
||||
PyErr_Clear();
|
||||
return val(Py(x));
|
||||
}
|
||||
x_array.call<int>("push", pythonToJs(item));
|
||||
Py_DECREF(item);
|
||||
|
|
Loading…
Reference in New Issue