bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
This commit is contained in:
@@ -686,9 +686,7 @@ class HTMLDoc(Doc):
|
||||
r'RFC[- ]?(\d+)|'
|
||||
r'PEP[- ]?(\d+)|'
|
||||
r'(self\.)?(\w+))')
|
||||
while True:
|
||||
match = pattern.search(text, here)
|
||||
if not match: break
|
||||
while match := pattern.search(text, here):
|
||||
start, end = match.span()
|
||||
results.append(escape(text[here:start]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user