Skip to content

Commit 42337a0

Browse files
authored
[mypyc] Don't use _PyUnicode_FastCopyCharacters on 3.13 (#17524)
Work on mypyc/mypyc#1056.
1 parent 45bb91e commit 42337a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mypyc/lib-rt/str_ops.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ PyObject *CPyStr_Build(Py_ssize_t len, ...) {
117117
PyObject *item = va_arg(args, PyObject *);
118118
Py_ssize_t itemlen = PyUnicode_GET_LENGTH(item);
119119
if (itemlen != 0) {
120+
#if CPY_3_13_FEATURES
121+
PyUnicode_CopyCharacters(res, res_offset, item, 0, itemlen);
122+
#else
120123
_PyUnicode_FastCopyCharacters(res, res_offset, item, 0, itemlen);
124+
#endif
121125
res_offset += itemlen;
122126
}
123127
}

0 commit comments

Comments
 (0)