summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2022-11-26 16:33:25 -0600
committerGitHub <noreply@github.com>2022-11-26 14:33:25 -0800
commit024ac542d738f56b36bdeb3517a10e93da5acab9 (patch)
tree7e54e0fcc68871e059ccff2adaf39b8a1808dcad /Lib/pydoc.py
parent25bc115df9d0e82309852609a83b5ab7f804cdc1 (diff)
downloadcpython-git-024ac542d738f56b36bdeb3517a10e93da5acab9.tar.gz
bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index c79ec77a8c..0a693f4523 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -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]))