MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / PyBytesWriter_Format

Function PyBytesWriter_Format

asyncpg/protocol/record/pythoncapi_compat.h:2536–2552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2534 Py_GCC_ATTRIBUTE((format(printf, 2, 3)));
2535
2536static inline int
2537PyBytesWriter_Format(PyBytesWriter *writer, const char *format, ...)
2538{
2539 va_list vargs;
2540 va_start(vargs, format);
2541 PyObject *str = PyBytes_FromFormatV(format, vargs);
2542 va_end(vargs);
2543
2544 if (str == NULL) {
2545 return -1;
2546 }
2547 int res = PyBytesWriter_WriteBytes(writer,
2548 PyBytes_AS_STRING(str),
2549 PyBytes_GET_SIZE(str));
2550 Py_DECREF(str);
2551 return res;
2552}
2553#endif // PY_VERSION_HEX < 0x030F00A1
2554
2555

Callers

nothing calls this directly

Calls 1

PyBytesWriter_WriteBytesFunction · 0.85

Tested by

no test coverage detected