mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.9] bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
co-authored by Nick Drozd
cherrypicked from 51a95be1d0
This commit is contained in:
parent
3c6173ca67
commit
fafd2dadf6
3 changed files with 7 additions and 16 deletions
|
@ -156,11 +156,8 @@ class ReplaceDialog(SearchDialogBase):
|
|||
first = last = None
|
||||
# XXX ought to replace circular instead of top-to-bottom when wrapping
|
||||
text.undo_block_start()
|
||||
while True:
|
||||
res = self.engine.search_forward(text, prog, line, col,
|
||||
wrap=False, ok=ok)
|
||||
if not res:
|
||||
break
|
||||
while (res := self.engine.search_forward(
|
||||
text, prog, line, col, wrap=False, ok=ok)):
|
||||
line, m = res
|
||||
chars = text.get("%d.0" % line, "%d.0" % (line+1))
|
||||
orig = m.group()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue