mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
This commit is contained in:
parent
25bc115df9
commit
024ac542d7
28 changed files with 41 additions and 153 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue