This commit is contained in:
Michael Droettboom 2018-07-23 11:21:57 -04:00
parent 59bf78f93c
commit 1aa2fc1265
3 changed files with 14 additions and 12 deletions

View File

@ -268,9 +268,9 @@ JsProxy_GetBuffer(PyObject* o, Py_buffer* view, int flags)
Py_ssize_t byteLength = hiwire_get_byteLength(self->js);
void *ptr;
void* ptr;
if (hiwire_is_on_wasm_heap(self->js)) {
ptr = (void *)hiwire_get_byteOffset(self->js);
ptr = (void*)hiwire_get_byteOffset(self->js);
} else {
if (self->bytes == NULL) {
self->bytes = PyBytes_FromStringAndSize(NULL, byteLength);
@ -347,8 +347,9 @@ JsProxy_GetBuffer(PyObject* o, Py_buffer* view, int flags)
}
static PyObject*
JsProxy_HasBytes(PyObject *o) {
JsProxy* self = (JsProxy *)o;
JsProxy_HasBytes(PyObject* o)
{
JsProxy* self = (JsProxy*)o;
if (self->bytes == NULL) {
Py_RETURN_FALSE;

View File

@ -9,19 +9,19 @@
extern PyObject* globals;
PyObject *eval_code;
PyObject* eval_code;
int
_runPython(char* code)
{
PyObject *py_code;
PyObject* py_code;
py_code = PyUnicode_FromString(code);
if (py_code == NULL) {
return pythonexc2js();
}
PyObject *ret = PyObject_CallFunctionObjArgs(
eval_code, py_code, globals, NULL);
PyObject* ret =
PyObject_CallFunctionObjArgs(eval_code, py_code, globals, NULL);
if (ret == NULL) {
return pythonexc2js();
@ -46,13 +46,15 @@ EM_JS(int, runpython_init_js, (), {
return 0;
});
int runpython_init_py() {
PyObject *m = PyImport_ImportModule("pyodide");
int
runpython_init_py()
{
PyObject* m = PyImport_ImportModule("pyodide");
if (m == NULL) {
return 1;
}
PyObject *d = PyModule_GetDict(m);
PyObject* d = PyModule_GetDict(m);
if (d == NULL) {
return 1;
}

View File

@ -311,4 +311,3 @@ def test_recursive_repr(selenium):
"except RecursionError:\n"
" result = False\n"
"result")