mirror of
https://github.com/python/cpython.git
synced 2025-08-20 00:32:12 +00:00
Avoid EOFError being passed to the caller (restoring the
old behavior).
This commit is contained in:
parent
7623294cb7
commit
b4dc921e30
1 changed files with 4 additions and 1 deletions
|
@ -597,7 +597,10 @@ class _BZ2Proxy(object):
|
||||||
raw = self.fileobj.read(self.blocksize)
|
raw = self.fileobj.read(self.blocksize)
|
||||||
if not raw:
|
if not raw:
|
||||||
break
|
break
|
||||||
data = self.bz2obj.decompress(raw)
|
try:
|
||||||
|
data = self.bz2obj.decompress(raw)
|
||||||
|
except EOFError:
|
||||||
|
break
|
||||||
b.append(data)
|
b.append(data)
|
||||||
x += len(data)
|
x += len(data)
|
||||||
self.buf = "".join(b)
|
self.buf = "".join(b)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue