summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-08-13 15:53:07 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-08-13 15:53:07 (GMT)
commit423be95dcf55b0b8737207beb7b30eb549430dba (patch)
treeb23453f2dc43d809aca931203a9580a81bd938fe /Modules/_struct.c
parent688356f59f3b0fe2412a5f66b79f0f9fdc4a98d2 (diff)
downloadcpython-423be95dcf55b0b8737207beb7b30eb549430dba.zip
cpython-423be95dcf55b0b8737207beb7b30eb549430dba.tar.gz
cpython-423be95dcf55b0b8737207beb7b30eb549430dba.tar.bz2
Merged revisions 65654 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65654 | martin.v.loewis | 2008-08-12 16:49:50 +0200 (Tue, 12 Aug 2008) | 6 lines Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple, by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*. ........
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 43be9ed..4a257c0 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1567,11 +1567,11 @@ s_unpack(PyObject *self, PyObject *input)
PyErr_Format(StructError,
"unpack requires a bytes argument of length %zd",
soself->s_size);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return NULL;
}
result = s_unpack_internal(soself, vbuf.buf);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return result;
}
@@ -1609,11 +1609,11 @@ s_unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
PyErr_Format(StructError,
"unpack_from requires a buffer of at least %zd bytes",
soself->s_size);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return NULL;
}
result = s_unpack_internal(soself, (char*)vbuf.buf + offset);
- PyObject_ReleaseBuffer(input, &vbuf);
+ PyBuffer_Release(&vbuf);
return result;
}