[Python-3000-checkins] r61397 - python/branches/py3k/Objects/abstract.c

gregory.p.smith python-3000-checkins at python.org
Sat Mar 15 07:05:36 CET 2008


Author: gregory.p.smith
Date: Sat Mar 15 07:05:36 2008
New Revision: 61397

Modified:
   python/branches/py3k/Objects/abstract.c
Log:
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.


Modified: python/branches/py3k/Objects/abstract.c
==============================================================================
--- python/branches/py3k/Objects/abstract.c	(original)
+++ python/branches/py3k/Objects/abstract.c	Sat Mar 15 07:05:36 2008
@@ -673,7 +673,7 @@
 {
 	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;


More information about the Python-3000-checkins mailing list