Skip to content

Commit af7c78f

Browse files
refactor: change double conditional to one (#3118)
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
1 parent 34c13c8 commit af7c78f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/urllib3/response.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -878,11 +878,7 @@ def read(
878878

879879
data = self._raw_read(amt)
880880

881-
flush_decoder = False
882-
if amt is None:
883-
flush_decoder = True
884-
elif amt != 0 and not data:
885-
flush_decoder = True
881+
flush_decoder = amt is None or (amt != 0 and not data)
886882

887883
if not data and len(self._decoded_buffer) == 0:
888884
return data

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy