async is a reserved keyword in python 3.7
This commit is contained in:
Enrico Forestieri 2018-08-17 22:28:03 +02:00
parent c5cab5a8f7
commit 061cd7fd9c

View File

@ -69,10 +69,10 @@ def removeFiles(filenames):
pass
def cmdOutput(cmd, async = False):
def cmdOutput(cmd, asynchronous = False):
'''utility function: run a command and get its output as a string
cmd: command to run
async: if False, return whole output as a string, otherwise
asynchronous: if False, return whole output as a string, otherwise
return the stdout handle from which the output can be
read (the caller is then responsible for closing it)
'''
@ -87,7 +87,7 @@ def cmdOutput(cmd, async = False):
pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, universal_newlines=True)
pipe.stdin.close()
if async:
if asynchronous:
return pipe.stdout
output = pipe.stdout.read()
pipe.stdout.close()