diff options
author | Nick Drozd <nicholasdrozd@gmail.com> | 2022-11-26 22:33:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-26 22:33:25 (GMT) |
commit | 024ac542d738f56b36bdeb3517a10e93da5acab9 (patch) | |
tree | 7e54e0fcc68871e059ccff2adaf39b8a1808dcad /Lib/mailcap.py | |
parent | 25bc115df9d0e82309852609a83b5ab7f804cdc1 (diff) | |
download | cpython-024ac542d738f56b36bdeb3517a10e93da5acab9.zip cpython-024ac542d738f56b36bdeb3517a10e93da5acab9.tar.gz cpython-024ac542d738f56b36bdeb3517a10e93da5acab9.tar.bz2 |
bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
Diffstat (limited to 'Lib/mailcap.py')
-rw-r--r-- | Lib/mailcap.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/mailcap.py b/Lib/mailcap.py index 7278ea7..2f4656e 100644 --- a/Lib/mailcap.py +++ b/Lib/mailcap.py @@ -90,9 +90,7 @@ def _readmailcapfile(fp, lineno): the viewing command is stored with the key "view". """ caps = {} - while 1: - line = fp.readline() - if not line: break + while line := fp.readline(): # Ignore comments and blank lines if line[0] == '#' or line.strip() == '': continue |