Skip to content

Commit c711afd

Browse files
committed
work around missing specialization for now
1 parent cc1f899 commit c711afd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ PyObject* _Py_BuildValue_SizeT(const char *format, ...) {
251251
# define APPEND_VALUE(list, value) PyList_Append(list, value); value_idx++
252252

253253
PyObject* (*converter)(void*) = NULL;
254+
char argchar[2] = {'\0'};
254255
unsigned int value_idx = 1;
255256
unsigned int format_idx = 0;
256257
build_stack *v = (build_stack*)calloc(1, sizeof(build_stack));
@@ -329,12 +330,12 @@ PyObject* _Py_BuildValue_SizeT(const char *format, ...) {
329330
APPEND_VALUE(list, (Py_ssize_t)ARG);
330331
break;
331332
case 'c':
332-
c = (char)ARG;
333-
APPEND_VALUE(list, PyBytes_FromStringAndSize(&c, 1));
333+
argchar[0] = (char)ARG;
334+
APPEND_VALUE(list, PyBytes_FromStringAndSize(argchar, 1));
334335
break;
335336
case 'C':
336-
c = (char)ARG;
337-
APPEND_VALUE(list, polyglot_from_string_n(&c, 1, "utf-8"));
337+
argchar[0] = (char)ARG;
338+
APPEND_VALUE(list, PyTruffle_Unicode_FromString(argchar));
338339
break;
339340
case 'd':
340341
case 'f':

0 commit comments

Comments
 (0)