Commit 57baae29 authored by Michael Droettboom's avatar Michael Droettboom

Support converting ArrayBuffer to Python bytes

parent 5f42b618
......@@ -33,7 +33,12 @@ PyObject *jsToPython(val x) {
Py_INCREF(pypy_x);
return pypy_x;
} else {
return JsProxy_cnew(x);
try {
std::string x_str = x.as<std::string>();
return PyBytes_FromStringAndSize(x_str.c_str(), x_str.size());
} catch (...) {
return JsProxy_cnew(x);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment