bpo-28953: Use `raise from` when raising new IncompleteRead (GH-29861)

Automerge-Triggered-By: GH:asvetlov
This commit is contained in:
180909 2021-12-07 08:10:49 +08:00 committed by GitHub
parent b7ef27bc08
commit c5c365220e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -593,8 +593,8 @@ class HTTPResponse(io.BufferedIOBase):
amt -= chunk_left
self.chunk_left = 0
return b''.join(value)
except IncompleteRead:
raise IncompleteRead(b''.join(value))
except IncompleteRead as exc:
raise IncompleteRead(b''.join(value)) from exc
def _readinto_chunked(self, b):
assert self.chunked != _UNKNOWN