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/sidebar.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/sidebar.py')
-rw-r--r-- | Lib/idlelib/sidebar.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/idlelib/sidebar.py b/Lib/idlelib/sidebar.py index 018c368..fb1084d 100644 --- a/Lib/idlelib/sidebar.py +++ b/Lib/idlelib/sidebar.py @@ -471,10 +471,7 @@ class ShellSidebar(BaseSideBar): index = text.index("@0,0") if index.split('.', 1)[1] != '0': index = text.index(f'{index}+1line linestart') - while True: - lineinfo = text.dlineinfo(index) - if lineinfo is None: - break + while (lineinfo := text.dlineinfo(index)) is not None: y = lineinfo[1] prev_newline_tagnames = text_tagnames(f"{index} linestart -1c") prompt = ( |