From 21286ccdbbf4c8853545392df087244fc8510293 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 16 Feb 2012 16:15:24 -0500 Subject: Add update-copyright as a submodule and update release.py accordingly. Also add `**kwargs` to `invoke` so we can specify the environment. --- libbe/util/subproc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libbe/util/subproc.py') diff --git a/libbe/util/subproc.py b/libbe/util/subproc.py index 2c45f0c..3a66f49 100644 --- a/libbe/util/subproc.py +++ b/libbe/util/subproc.py @@ -48,7 +48,7 @@ class CommandError(Exception): def invoke(args, stdin=None, stdout=PIPE, stderr=PIPE, expect=(0,), cwd=None, shell=None, unicode_output=True, verbose=False, - encoding=None): + encoding=None, **kwargs): """ expect should be a tuple of allowed exit codes. cwd should be the directory from which the command will be executed. When @@ -70,14 +70,14 @@ def invoke(args, stdin=None, stdout=PIPE, stderr=PIPE, expect=(0,), if shell is None: shell = False q = Popen(args, stdin=PIPE, stdout=stdout, stderr=stderr, - shell=shell, cwd=cwd) + shell=shell, cwd=cwd, **kwargs) else: assert _MSWINDOWS==True, 'invalid platform' if shell is None: shell = True # win32 don't have os.execvp() so have to run command in a shell q = Popen(args, stdin=PIPE, stdout=stdout, stderr=stderr, - shell=shell, cwd=cwd) + shell=shell, cwd=cwd, **kwargs) except OSError, e: raise CommandError(list_args, status=e.args[0], stderr=e) stdout,stderr = q.communicate(input=stdin) -- cgit