mirror of https://github.com/pyodide/pyodide.git
Support converting ArrayBuffer to Python bytes
This commit is contained in:
parent
5f42b61862
commit
57baae294f
|
@ -33,9 +33,14 @@ 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) {
|
||||
if (!Array->call<bool>("isArray", args)) {
|
||||
|
|
Loading…
Reference in New Issue