mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
(cherry picked from commit 51a95be1d0)
Co-authored-by: Nick Drozd <nicholasdrozd@gmail.com>
This commit is contained in:
parent
5765eaa136
commit
2ddc278875
5 changed files with 9 additions and 24 deletions
|
|
@ -482,9 +482,7 @@ def read(self, size=-1):
|
|||
result = self._line_buffer
|
||||
self._line_buffer = ''
|
||||
if size < 0:
|
||||
while True:
|
||||
line = self.shell.readline()
|
||||
if not line: break
|
||||
while (line := self.shell.readline()):
|
||||
result += line
|
||||
else:
|
||||
while len(result) < size:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue