| 1509 | } |
| 1510 | |
| 1511 | static inline int |
| 1512 | PyUnicodeWriter_Format(PyUnicodeWriter *writer, const char *format, ...) |
| 1513 | { |
| 1514 | va_list vargs; |
| 1515 | va_start(vargs, format); |
| 1516 | PyObject *str = PyUnicode_FromFormatV(format, vargs); |
| 1517 | va_end(vargs); |
| 1518 | if (str == _Py_NULL) { |
| 1519 | return -1; |
| 1520 | } |
| 1521 | |
| 1522 | int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str); |
| 1523 | Py_DECREF(str); |
| 1524 | return res; |
| 1525 | } |
| 1526 | #endif // PY_VERSION_HEX < 0x030E0000 |
| 1527 | |
| 1528 | // gh-116560 added PyLong_GetSign() to Python 3.14.0a0 |