changeset: 94478:0024537a4687 parent: 94475:2e684ce772de user: Serhiy Storchaka date: Tue Feb 03 01:49:18 2015 +0200 files: Objects/bytesobject.c description: Issue #22896: Fixed using _getbuffer() in recently added _PyBytes_Format(). diff -r 2e684ce772de -r 0024537a4687 Objects/bytesobject.c --- a/Objects/bytesobject.c Tue Feb 03 01:25:42 2015 +0200 +++ b/Objects/bytesobject.c Tue Feb 03 01:49:18 2015 +0200 @@ -622,14 +622,13 @@ int isnumok; PyObject *v = NULL; PyObject *temp = NULL; - Py_buffer buf; + Py_buffer buf = {NULL, NULL}; char *pbuf; int sign; Py_ssize_t len; char formatbuf[FORMATBUFLEN]; /* For format{int,char}() */ - buf.obj = NULL; fmt++; if (*fmt == '(') { char *keystart; @@ -790,7 +789,7 @@ Py_DECREF(temp); goto error; } - if (_getbuffer(repr, &buf) < 0) { + if (PyObject_GetBuffer(repr, &buf, PyBUF_SIMPLE) != 0) { temp = format_obj(repr); if (temp == NULL) { Py_DECREF(repr);