Skip to content

Commit 3c903bc

Browse files
committed
Refactor 'pythonrun.c'.
1 parent 415c077 commit 3c903bc

File tree

1 file changed

+2
-9
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+2
-9
lines changed

graalpython/com.oracle.graal.python.cext/src/pythonrun.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939
#include "capi.h"
4040

41-
PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char* source, int type, PyObject* globals, PyObject* locals, PyCompilerFlags* ignored) {
41+
PyObject* PyRun_StringFlags(const char* source, int type, PyObject* globals, PyObject* locals, PyCompilerFlags* ignored) {
4242
const char* stype;
4343
if (type == Py_single_input) {
4444
stype = "single";
@@ -49,13 +49,6 @@ PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char* source, int type, PyObject*
4949
} else {
5050
return NULL;
5151
}
52-
PyObject* result = truffle_invoke(PY_TRUFFLE_CEXT, "PyRun_String", truffle_read_string(source),
53-
truffle_read_string(stype), to_java(globals), to_java(locals),
54-
ERROR_MARKER);
55-
if (result == ERROR_MARKER) {
56-
return NULL;
57-
} else {
58-
return to_sulong(result);
59-
}
52+
return UPCALL_CEXT_O("PyRun_String", polyglot_from_string(source, SRC_CS), polyglot_from_string(stype, SRC_CS), native_to_java(globals), native_to_java(locals));
6053
}
6154

0 commit comments

Comments
 (0)