summaryrefslogtreecommitdiff
path: root/Lib/xml/dom
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2022-11-26 16:33:25 -0600
committerGitHub <noreply@github.com>2022-11-26 14:33:25 -0800
commit024ac542d738f56b36bdeb3517a10e93da5acab9 (patch)
tree7e54e0fcc68871e059ccff2adaf39b8a1808dcad /Lib/xml/dom
parent25bc115df9d0e82309852609a83b5ab7f804cdc1 (diff)
downloadcpython-git-024ac542d738f56b36bdeb3517a10e93da5acab9.tar.gz
bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r--Lib/xml/dom/expatbuilder.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/xml/dom/expatbuilder.py b/Lib/xml/dom/expatbuilder.py
index 199c22d0af..7dd667bf3f 100644
--- a/Lib/xml/dom/expatbuilder.py
+++ b/Lib/xml/dom/expatbuilder.py
@@ -200,10 +200,7 @@ class ExpatBuilder:
parser = self.getParser()
first_buffer = True
try:
- while 1:
- buffer = file.read(16*1024)
- if not buffer:
- break
+ while buffer := file.read(16*1024):
parser.Parse(buffer, False)
if first_buffer and self.document.documentElement:
self._setup_subset(buffer)