]> granicus.if.org Git - python/commitdiff
Fix the return value of BZ2File._read_block() to be consistent with comments.
authorNadeem Vawda <nadeem.vawda@gmail.com>
Sun, 30 Sep 2012 11:41:29 +0000 (13:41 +0200)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Sun, 30 Sep 2012 11:41:29 +0000 (13:41 +0200)
Lib/bz2.py

index 61d989bcaceaff8d6ebc6edc63c06a45fcf44759..fe4118f9a7a28133bad4beaf2db0a1a2b36621d1 100644 (file)
@@ -226,7 +226,7 @@ class BZ2File(io.BufferedIOBase):
             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:]