mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +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
|
@ -566,10 +566,7 @@ class ElementTree:
|
|||
# it with chunks.
|
||||
self._root = parser._parse_whole(source)
|
||||
return self._root
|
||||
while True:
|
||||
data = source.read(65536)
|
||||
if not data:
|
||||
break
|
||||
while data := source.read(65536):
|
||||
parser.feed(data)
|
||||
self._root = parser.close()
|
||||
return self._root
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue