mirror of
https://github.com/python/cpython.git
synced 2025-09-09 02:11:51 +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
|
@ -120,10 +120,8 @@ class IncrementalParser(XMLReader):
|
|||
file = source.getCharacterStream()
|
||||
if file is None:
|
||||
file = source.getByteStream()
|
||||
buffer = file.read(self._bufsize)
|
||||
while buffer:
|
||||
while buffer := file.read(self._bufsize):
|
||||
self.feed(buffer)
|
||||
buffer = file.read(self._bufsize)
|
||||
self.close()
|
||||
|
||||
def feed(self, data):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue