[Python-checkins] cpython (3.3): Fix the return value of BZ2File._read_block() to be consistent with comments.

nadeem.vawda python-checkins at python.org
Sun Sep 30 13:45:42 CEST 2012


http://hg.python.org/cpython/rev/1b4190d918c9
changeset:   79317:1b4190d918c9
branch:      3.3
parent:      79315:f66ff96f0030
user:        Nadeem Vawda <nadeem.vawda at gmail.com>
date:        Sun Sep 30 13:41:29 2012 +0200
summary:
  Fix the return value of BZ2File._read_block() to be consistent with comments.

files:
  Lib/bz2.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/bz2.py b/Lib/bz2.py
--- a/Lib/bz2.py
+++ b/Lib/bz2.py
@@ -226,7 +226,7 @@
             data = self._buffer[self._buffer_offset : end]
             self._buffer_offset = end
             self._pos += len(data)
-            return data
+            return data if return_data else None
 
         # The loop assumes that _buffer_offset is 0. Ensure that this is true.
         self._buffer = self._buffer[self._buffer_offset:]

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list