| 1439 | } |
| 1440 | |
| 1441 | static inline int |
| 1442 | PyUnicodeWriter_WriteUTF8(PyUnicodeWriter *writer, |
| 1443 | const char *str, Py_ssize_t size) |
| 1444 | { |
| 1445 | if (size < 0) { |
| 1446 | size = (Py_ssize_t)strlen(str); |
| 1447 | } |
| 1448 | |
| 1449 | PyObject *str_obj = PyUnicode_FromStringAndSize(str, size); |
| 1450 | if (str_obj == _Py_NULL) { |
| 1451 | return -1; |
| 1452 | } |
| 1453 | |
| 1454 | int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str_obj); |
| 1455 | Py_DECREF(str_obj); |
| 1456 | return res; |
| 1457 | } |
| 1458 | |
| 1459 | static inline int |
| 1460 | PyUnicodeWriter_WriteASCII(PyUnicodeWriter *writer, |
nothing calls this directly
no outgoing calls
no test coverage detected