summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-09-30 11:41:29 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-09-30 11:41:29 (GMT)
commit9e2a28ea54107e0f9c91ae3094974a310d0da027 (patch)
tree66561c4ce78301c715d1066feea2aab943d92428 /Lib
parent28714c8c26d72cfb3cee4d05f9f5b7390cda291b (diff)
downloadcpython-9e2a28ea54107e0f9c91ae3094974a310d0da027.zip
cpython-9e2a28ea54107e0f9c91ae3094974a310d0da027.tar.gz
cpython-9e2a28ea54107e0f9c91ae3094974a310d0da027.tar.bz2
Fix the return value of BZ2File._read_block() to be consistent with comments.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/bz2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/bz2.py b/Lib/bz2.py
index 61d989b..fe4118f 100644
--- a/Lib/bz2.py
+++ b/Lib/bz2.py
@@ -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:]