Code cosmetics

This commit is contained in:
Ozzieisaacs
2020-04-19 19:08:58 +02:00
parent 7bb5afa585
commit 24c743d23d
15 changed files with 262 additions and 192 deletions
+5 -5
View File
@@ -45,10 +45,10 @@ def process_open(command, quotes=(), env=None, sout=subprocess.PIPE, serr=subpro
def process_wait(command, serr=subprocess.PIPE):
'''Run command, wait for process to terminate, and return an iterator over lines of its output.'''
# Run command, wait for process to terminate, and return an iterator over lines of its output.
p = process_open(command, serr=serr)
p.wait()
for l in p.stdout.readlines():
if isinstance(l, bytes):
l = l.decode('utf-8')
yield l
for line in p.stdout.readlines():
if isinstance(line, bytes):
line = line.decode('utf-8')
yield line