diff options
author | Nick Drozd <nicholasdrozd@gmail.com> | 2022-02-03 01:59:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 01:59:24 (GMT) |
commit | 51a95be1d035a717ab29e98056b8831a98e61125 (patch) | |
tree | e50beac085f7ae2fb5bac1104571804aa93e0053 /Lib/idlelib/run.py | |
parent | 164a017e13ee96bd1ea1ae79f5ac9e25fe83994e (diff) | |
download | cpython-51a95be1d035a717ab29e98056b8831a98e61125.zip cpython-51a95be1d035a717ab29e98056b8831a98e61125.tar.gz cpython-51a95be1d035a717ab29e98056b8831a98e61125.tar.bz2 |
bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
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 47c4cbd..01f8d65 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: |