Allow args/kwargs for exec command

This commit is contained in:
Ivan Kravets
2015-01-29 18:54:28 +02:00
parent 00f75c753d
commit 6e93806b12

View File

@ -85,9 +85,12 @@ def change_filemtime(path, time):
utime(path, (time, time))
def exec_command(args):
use_shell = system() == "Windows"
p = Popen(args, stdout=PIPE, stderr=PIPE, shell=use_shell)
def exec_command(*args, **kwargs):
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
kwargs['shell'] = system() == "Windows"
p = Popen(*args, **kwargs)
out, err = p.communicate()
return dict(out=out.strip(), err=err.strip())