Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 138ad50

Browse files
committed
Fix error handling in new fast path of BZ2File.readline().
1 parent 452add0 commit 138ad50

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Lib/bz2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def readline(self, size=-1):
323323
raise TypeError("Integer argument expected")
324324
size = size.__index__()
325325
with self._lock:
326+
self._check_can_read()
326327
# Shortcut for the common case - the whole line is in the buffer.
327328
if size < 0:
328329
end = self._buffer.find(b"\n", self._buffer_offset) + 1

0 commit comments

Comments
 (0)