Skip to content

Commit 6bd11c1

Browse files
committed
add PyUnicodeDecodeError_Create
1 parent aa82894 commit 6bd11c1

File tree

6 files changed

+655
-616
lines changed

6 files changed

+655
-616
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
@@ -2221,6 +2221,10 @@ PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject* a) {
22212221
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject* a, PyTypeObject* b) {
22222222
return GraalPyType_IsSubtype(a, b);
22232223
}
2224+
#undef PyUnicodeDecodeError_Create
2225+
PyAPI_FUNC(PyObject*) PyUnicodeDecodeError_Create(const char* a, const char* b, Py_ssize_t c, Py_ssize_t d, Py_ssize_t e, const char* f) {
2226+
return GraalPyUnicodeDecodeError_Create(truffleString(a), b, c, d, e, truffleString(f));
2227+
}
22242228
#undef PyUnicode_AsEncodedString
22252229
PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString(PyObject* a, const char* b, const char* c) {
22262230
return GraalPyUnicode_AsEncodedString(a, truffleString(b), truffleString(c));

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ typedef struct {
380380
BUILTIN(PyTuple_SetItem, int, PyObject*, Py_ssize_t, PyObject*) \
381381
BUILTIN(PyTuple_Size, Py_ssize_t, PyObject*) \
382382
BUILTIN(PyType_IsSubtype, int, PyTypeObject*, PyTypeObject*) \
383+
BUILTIN(PyUnicodeDecodeError_Create, PyObject*, const char*, const char*, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char*) \
383384
BUILTIN(PyUnicode_AsEncodedString, PyObject*, PyObject*, const char*, const char*) \
384385
BUILTIN(PyUnicode_AsUnicodeEscapeString, PyObject*, PyObject*) \
385386
BUILTIN(PyUnicode_Compare, int, PyObject*, PyObject*) \

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4038,8 +4038,10 @@ PyAPI_FUNC(int) PyType_Ready(PyTypeObject* a) {
40384038
int result = (int) __target__PyType_Ready(a);
40394039
return result;
40404040
}
4041+
PyObject* (*__target__PyUnicodeDecodeError_Create)(const char*, const char*, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char*) = NULL;
40414042
PyAPI_FUNC(PyObject*) PyUnicodeDecodeError_Create(const char* a, const char* b, Py_ssize_t c, Py_ssize_t d, Py_ssize_t e, const char* f) {
4042-
unimplemented("PyUnicodeDecodeError_Create"); exit(-1);
4043+
PyObject* result = (PyObject*) __target__PyUnicodeDecodeError_Create(a, b, c, d, e, f);
4044+
return result;
40434045
}
40444046
PyAPI_FUNC(PyObject*) PyUnicodeDecodeError_GetEncoding(PyObject* a) {
40454047
unimplemented("PyUnicodeDecodeError_GetEncoding"); exit(-1);
@@ -6376,6 +6378,7 @@ void initializeCAPIForwards(void* (*getAPI)(const char*)) {
63766378
__target__PyType_GetSlot = getAPI("PyType_GetSlot");
63776379
__target__PyType_Modified = getAPI("PyType_Modified");
63786380
__target__PyType_Ready = getAPI("PyType_Ready");
6381+
__target__PyUnicodeDecodeError_Create = getAPI("PyUnicodeDecodeError_Create");
63796382
__target__PyUnicode_Append = getAPI("PyUnicode_Append");
63806383
__target__PyUnicode_AppendAndDel = getAPI("PyUnicode_AppendAndDel");
63816384
__target__PyUnicode_AsASCIIString = getAPI("PyUnicode_AsASCIIString");

0 commit comments

Comments
 (0)