diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-02-02 18:28:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 18:28:52 -0800 |
commit | 2ddc278875f789de622262ee8ff5a1c3788f031c (patch) | |
tree | a980bdaaddc7caa6d6006f0590ab7b67ad65decd /Lib/idlelib/run.py | |
parent | 5765eaa13654e5f812a286700da7d6b8e144da0e (diff) | |
download | cpython-git-2ddc278875f789de622262ee8ff5a1c3788f031c.tar.gz |
bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
(cherry picked from commit 51a95be1d035a717ab29e98056b8831a98e61125)
Co-authored-by: Nick Drozd <nicholasdrozd@gmail.com>
Diffstat (limited to 'Lib/idlelib/run.py')
-rw-r--r-- | Lib/idlelib/run.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 47c4cbdcb8..01f8d65426 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -482,9 +482,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: |