mirror of
https://github.com/python/cpython
synced 2026-09-29 09:50:29 +03:00
Fix error handling in new fast path of BZ2File.readline().
This commit is contained in:
parent
452add08a1
commit
138ad5066d
1 changed files with 1 additions and 0 deletions
|
|
@ -323,6 +323,7 @@ class BZ2File(io.BufferedIOBase):
|
|||
raise TypeError("Integer argument expected")
|
||||
size = size.__index__()
|
||||
with self._lock:
|
||||
self._check_can_read()
|
||||
# Shortcut for the common case - the whole line is in the buffer.
|
||||
if size < 0:
|
||||
end = self._buffer.find(b"\n", self._buffer_offset) + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue