mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix an apparent typo. This test of the readonly boolean should have been != 0
rather than >= 0. This change means the PyBUF_LOCK flag to the buffer api works on immutable bytes objects as one would expect.
This commit is contained in:
parent
deef67481c
commit
4621875407
1 changed files with 1 additions and 1 deletions
|
@ -673,7 +673,7 @@ PyBuffer_FillInfo(Py_buffer *view, void *buf, Py_ssize_t len,
|
|||
{
|
||||
if (view == NULL) return 0;
|
||||
if (((flags & PyBUF_LOCK) == PyBUF_LOCK) &&
|
||||
readonly >= 0) {
|
||||
readonly != 0) {
|
||||
PyErr_SetString(PyExc_BufferError,
|
||||
"Cannot lock this object.");
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue