mirror of https://github.com/pyodide/pyodide.git
Support converting ArrayBuffer to Python bytes
This commit is contained in:
parent
5f42b61862
commit
57baae294f
|
@ -33,8 +33,13 @@ PyObject *jsToPython(val x) {
|
|||
Py_INCREF(pypy_x);
|
||||
return pypy_x;
|
||||
} else {
|
||||
try {
|
||||
std::string x_str = x.as<std::string>();
|
||||
return PyBytes_FromStringAndSize(x_str.c_str(), x_str.size());
|
||||
} catch (...) {
|
||||
return JsProxy_cnew(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PyObject *jsToPythonArgs(val args) {
|
||||
|
|
Loading…
Reference in New Issue