Avoid EOFError being passed to the caller (restoring the

old behavior).
This commit is contained in:
Lars Gustäbel 2009-03-22 21:29:48 +00:00
parent 9e2a09a3a3
commit 4f908ddc88
1 changed files with 4 additions and 1 deletions

View File

@ -665,7 +665,10 @@ class _BZ2Proxy(object):
raw = self.fileobj.read(self.blocksize)
if not raw:
break
data = self.bz2obj.decompress(raw)
try:
data = self.bz2obj.decompress(raw)
except EOFError:
break
b.append(data)
x += len(data)
self.buf = "".join(b)