Skip to content

Commit 6d806fe

Browse files
committed
add Py_CompileString
1 parent da68d69 commit 6d806fe

File tree

6 files changed

+612
-574
lines changed

6 files changed

+612
-574
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,6 +2285,10 @@ PyAPI_FUNC(PyObject*) PyWeakref_NewRef(PyObject* a, PyObject* b) {
22852285
PyAPI_FUNC(int) Py_AtExit(void (*a)(void)) {
22862286
return GraalPy_AtExit(a);
22872287
}
2288+
#undef Py_CompileString
2289+
PyAPI_FUNC(PyObject*) Py_CompileString(const char* a, const char* b, int c) {
2290+
return GraalPy_CompileString(truffleString(a), truffleString(b), c);
2291+
}
22882292
#undef Py_EnterRecursiveCall
22892293
PyAPI_FUNC(int) Py_EnterRecursiveCall(const char* a) {
22902294
return GraalPy_EnterRecursiveCall(a);

graalpython/com.oracle.graal.python.cext/src/capi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ typedef struct {
396396
BUILTIN(PyWeakref_GetObject, PyObject*, PyObject*) \
397397
BUILTIN(PyWeakref_NewRef, PyObject*, PyObject*, PyObject*) \
398398
BUILTIN(Py_AtExit, int, void (*)(void)) \
399+
BUILTIN(Py_CompileString, PyObject*, const char*, const char*, int) \
399400
BUILTIN(Py_EnterRecursiveCall, int, const char*) \
400401
BUILTIN(Py_GenericAlias, PyObject*, PyObject*, PyObject*) \
401402
BUILTIN(Py_LeaveRecursiveCall, void) \

graalpython/com.oracle.graal.python.jni/src/capi_forwards.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4522,8 +4522,10 @@ PyAPI_FUNC(int) Py_AtExit(void (*a)(void)) {
45224522
PyAPI_FUNC(int) Py_BytesMain(int a, char** b) {
45234523
unimplemented("Py_BytesMain"); exit(-1);
45244524
}
4525+
PyObject* (*__target__Py_CompileString)(const char*, const char*, int) = NULL;
45254526
PyAPI_FUNC(PyObject*) Py_CompileString(const char* a, const char* b, int c) {
4526-
unimplemented("Py_CompileString"); exit(-1);
4527+
PyObject* result = (PyObject*) __target__Py_CompileString(a, b, c);
4528+
return result;
45274529
}
45284530
PyAPI_FUNC(PyObject*) Py_CompileStringExFlags(const char* a, const char* b, int c, PyCompilerFlags* d, int e) {
45294531
unimplemented("Py_CompileStringExFlags"); exit(-1);
@@ -6400,6 +6402,7 @@ void initializeCAPIForwards(void* (*getAPI)(const char*)) {
64006402
__target__PyUnicode_InternInPlace = getAPI("PyUnicode_InternInPlace");
64016403
__target__PyUnicode_New = getAPI("PyUnicode_New");
64026404
__target__PyVectorcall_Call = getAPI("PyVectorcall_Call");
6405+
__target__Py_CompileString = getAPI("Py_CompileString");
64036406
__target__Py_GetBuildInfo = getAPI("Py_GetBuildInfo");
64046407
__target__Py_GetCompiler = getAPI("Py_GetCompiler");
64056408
__target__Py_GetVersion = getAPI("Py_GetVersion");

0 commit comments

Comments
 (0)