summaryrefslogtreecommitdiff
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 075edf8c67..3aa905c6fc 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3995,3 +3995,17 @@ _PyBytesWriter_Finish(_PyBytesWriter *writer, char *str)
return result;
}
+
+char*
+_PyBytesWriter_WriteBytes(_PyBytesWriter *writer, char *str,
+ char *bytes, Py_ssize_t size)
+{
+ str = _PyBytesWriter_Prepare(writer, str, size);
+ if (str == NULL)
+ return NULL;
+
+ Py_MEMCPY(str, bytes, size);
+ str += size;
+
+ return str;
+}