| 1401 | } |
| 1402 | |
| 1403 | static inline int |
| 1404 | PyUnicodeWriter_WriteChar(PyUnicodeWriter *writer, Py_UCS4 ch) |
| 1405 | { |
| 1406 | if (ch > 0x10ffff) { |
| 1407 | PyErr_SetString(PyExc_ValueError, |
| 1408 | "character must be in range(0x110000)"); |
| 1409 | return -1; |
| 1410 | } |
| 1411 | |
| 1412 | return _PyUnicodeWriter_WriteChar((_PyUnicodeWriter*)writer, ch); |
| 1413 | } |
| 1414 | |
| 1415 | static inline int |
| 1416 | PyUnicodeWriter_WriteStr(PyUnicodeWriter *writer, PyObject *obj) |