Update client.py (GH-24827)

This commit is contained in:
Géry Ogam 2021-03-13 13:22:03 +01:00 committed by GitHub
parent 7591d9455e
commit b6884ad268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -349,9 +349,6 @@ class HTTPResponse(io.BufferedIOBase):
# NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
self.length = None
length = self.headers.get("content-length")
# are we using the chunked-style of transfer encoding?
tr_enc = self.headers.get("transfer-encoding")
if length and not self.chunked:
try:
self.length = int(length)