mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +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
|
|
@ -179,14 +179,10 @@ def find_good_parse_start(self, is_char_in_string):
|
|||
# Peeking back worked; look forward until _synchre no longer
|
||||
# matches.
|
||||
i = pos + 1
|
||||
while 1:
|
||||
m = _synchre(code, i)
|
||||
if m:
|
||||
s, i = m.span()
|
||||
if not is_char_in_string(s):
|
||||
pos = s
|
||||
else:
|
||||
break
|
||||
while (m := _synchre(code, i)):
|
||||
s, i = m.span()
|
||||
if not is_char_in_string(s):
|
||||
pos = s
|
||||
return pos
|
||||
|
||||
def set_lo(self, lo):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue