summaryrefslogtreecommitdiff
path: root/Lib/idlelib/idle_test/test_sidebar.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-02-02 18:28:52 -0800
committerGitHub <noreply@github.com>2022-02-02 18:28:52 -0800
commit2ddc278875f789de622262ee8ff5a1c3788f031c (patch)
treea980bdaaddc7caa6d6006f0590ab7b67ad65decd /Lib/idlelib/idle_test/test_sidebar.py
parent5765eaa13654e5f812a286700da7d6b8e144da0e (diff)
downloadcpython-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/idle_test/test_sidebar.py')
-rw-r--r--Lib/idlelib/idle_test/test_sidebar.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/idlelib/idle_test/test_sidebar.py b/Lib/idlelib/idle_test/test_sidebar.py
index 53ac3eb273..01fd6a04d0 100644
--- a/Lib/idlelib/idle_test/test_sidebar.py
+++ b/Lib/idlelib/idle_test/test_sidebar.py
@@ -474,10 +474,7 @@ class ShellSidebarTest(unittest.TestCase):
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_coords.append(lineinfo[1])
index = text.index(f"{index} +1line")
return y_coords