From bcdd9149d4a887a312e4b0b358eef65a4b5a1ca6 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Tue, 10 Jul 2018 18:13:36 +0500 Subject: [PATCH] Simplified HttpRequest.__iter__(). --- django/http/request.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/django/http/request.py b/django/http/request.py index 3440e3b95d7..4e4447f35fd 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -346,11 +346,7 @@ class HttpRequest: raise UnreadablePostError(*e.args) from e def __iter__(self): - while True: - buf = self.readline() - if not buf: - break - yield buf + return iter(self.readline, b'') def xreadlines(self): warnings.warn(