aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/idlelib/idle_test
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2022-02-02 19:59:24 -0600
committerGitHub <noreply@github.com>2022-02-02 20:59:24 -0500
commit51a95be1d035a717ab29e98056b8831a98e61125 (patch)
treee50beac085f7ae2fb5bac1104571804aa93e0053 /Lib/idlelib/idle_test
parent164a017e13ee96bd1ea1ae79f5ac9e25fe83994e (diff)
downloadcpython-51a95be1d035a717ab29e98056b8831a98e61125.tar.gz
cpython-51a95be1d035a717ab29e98056b8831a98e61125.zip
bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
Diffstat (limited to 'Lib/idlelib/idle_test')
-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 53ac3eb2733..01fd6a04d0d 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