From 9e2a28ea54107e0f9c91ae3094974a310d0da027 Mon Sep 17 00:00:00 2001 From: Nadeem Vawda Date: Sun, 30 Sep 2012 13:41:29 +0200 Subject: [PATCH] Fix the return value of BZ2File._read_block() to be consistent with comments. --- Lib/bz2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/bz2.py b/Lib/bz2.py index 61d989bcace..fe4118f9a7a 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:]