mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
[3.9] bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
co-authored by Nick Drozd
cherrypicked from 51a95be1d0
This commit is contained in:
parent
3c6173ca67
commit
fafd2dadf6
3 changed files with 7 additions and 16 deletions
|
@ -468,9 +468,7 @@ class StdInputFile(StdioFile):
|
|||
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