cpython: 0024537a4687 (original) (raw)
Mercurial > cpython
changeset 94478:0024537a4687
Issue #22896: Fixed using _getbuffer() in recently added _PyBytes_Format(). [#22896]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Tue, 03 Feb 2015 01:49:18 +0200 |
parents | 2e684ce772de |
children | 4cb316fe6bf2 |
files | Objects/bytesobject.c |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-)[+] [-] Objects/bytesobject.c 5 |
line wrap: on
line diff
--- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -622,14 +622,13 @@ PyObject * int isnumok; PyObject *v = NULL; PyObject *temp = NULL;
Py_buffer buf;[](#l1.7)
Py_buffer buf = {NULL, NULL};[](#l1.8) char *pbuf;[](#l1.9) int sign;[](#l1.10) Py_ssize_t len;[](#l1.11) char formatbuf[FORMATBUFLEN];[](#l1.12) /* For format{int,char}() */[](#l1.13)
buf.obj = NULL;[](#l1.15) fmt++;[](#l1.16) if (*fmt == '(') {[](#l1.17) char *keystart;[](#l1.18)
@@ -790,7 +789,7 @@ PyObject * Py_DECREF(temp); goto error; }
if (_getbuffer(repr, &buf) < 0) {[](#l1.23)
if (PyObject_GetBuffer(repr, &buf, PyBUF_SIMPLE) != 0) {[](#l1.24) temp = format_obj(repr);[](#l1.25) if (temp == NULL) {[](#l1.26) Py_DECREF(repr);[](#l1.27)