mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
(cherry picked from commit 51a95be1d0)
Co-authored-by: Nick Drozd <nicholasdrozd@gmail.com>
This commit is contained in:
parent
5765eaa136
commit
2ddc278875
5 changed files with 9 additions and 24 deletions
|
|
@ -474,10 +474,7 @@ def get_shell_line_y_coords(self):
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue