Update client.py (GH-24827)

(cherry picked from commit b6884ad268)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-03-13 04:44:36 -08:00 committed by GitHub
parent 5c674e4479
commit 53ab4af444
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)