diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-03-15 06:05:36 +0000 |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-03-15 06:05:36 +0000 |
commit | 462187540764e3bcc2324fb0d51315f5c28ed088 (patch) | |
tree | ba7023c155501556bc14a876571b37b8af94ecd1 | |
parent | deef67481c37965474b64c7e703982998c20a654 (diff) | |
download | cpython-git-462187540764e3bcc2324fb0d51315f5c28ed088.tar.gz |
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.
-rw-r--r-- | Objects/abstract.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 655a52a0be..c0298a8aa3 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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; |