diff options
author | Nick Drozd <nicholasdrozd@gmail.com> | 2022-11-26 16:33:25 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-26 14:33:25 -0800 |
commit | 024ac542d738f56b36bdeb3517a10e93da5acab9 (patch) | |
tree | 7e54e0fcc68871e059ccff2adaf39b8a1808dcad /Lib/email | |
parent | 25bc115df9d0e82309852609a83b5ab7f804cdc1 (diff) | |
download | cpython-024ac542d738f56b36bdeb3517a10e93da5acab9.tar.gz cpython-024ac542d738f56b36bdeb3517a10e93da5acab9.zip |
bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/parser.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/email/parser.py b/Lib/email/parser.py index 7db4da1ff08..e94d455baa5 100644 --- a/Lib/email/parser.py +++ b/Lib/email/parser.py @@ -49,10 +49,7 @@ class Parser: feedparser = FeedParser(self._class, policy=self.policy) if headersonly: feedparser._set_headersonly() - while True: - data = fp.read(8192) - if not data: - break + while data := fp.read(8192): feedparser.feed(data) return feedparser.close() |