mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
util: use iter(callable, sentinel)
instead of while True
This is functionally equivalent, but is a little more concise.
This commit is contained in:
parent
be01ef28d0
commit
a1cb15c378
@ -1012,10 +1012,7 @@ def system(cmd, environ=None, cwd=None, onerr=None, errprefix=None, out=None):
|
||||
proc = subprocess.Popen(cmd, shell=True, close_fds=closefds,
|
||||
env=env, cwd=cwd, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
while True:
|
||||
line = proc.stdout.readline()
|
||||
if not line:
|
||||
break
|
||||
for line in iter(proc.stdout.readline, ''):
|
||||
out.write(line)
|
||||
proc.wait()
|
||||
rc = proc.returncode
|
||||
|
Loading…
Reference in New Issue
Block a user