mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
This commit is contained in:
parent
25bc115df9
commit
024ac542d7
28 changed files with 41 additions and 153 deletions
|
@ -108,12 +108,8 @@ def get_ld_headers(file):
|
|||
p = Popen(["/usr/bin/dump", f"-X{AIX_ABI}", "-H", file],
|
||||
universal_newlines=True, stdout=PIPE, stderr=DEVNULL)
|
||||
# be sure to read to the end-of-file - getting all entries
|
||||
while True:
|
||||
ld_header = get_ld_header(p)
|
||||
if ld_header:
|
||||
ldr_headers.append((ld_header, get_ld_header_info(p)))
|
||||
else:
|
||||
break
|
||||
while ld_header := get_ld_header(p):
|
||||
ldr_headers.append((ld_header, get_ld_header_info(p)))
|
||||
p.stdout.close()
|
||||
p.wait()
|
||||
return ldr_headers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue