From 05733acd4c7a9de98156378045d4e4050cfb65db Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Wed, 17 Aug 2011 15:32:16 +0000 Subject: allow changing stdin when executing command --- MgaRepo/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'MgaRepo') diff --git a/MgaRepo/util.py b/MgaRepo/util.py index c73c098..e8aef0a 100644 --- a/MgaRepo/util.py +++ b/MgaRepo/util.py @@ -27,8 +27,10 @@ def execcmd(*cmd, **kwargs): if kwargs.get("show"): if kwargs.get("geterr"): err = StringIO() + pstdin = kwargs.get("stdin") if kwargs.get("stdin") else None pipe = subprocess.Popen(cmdstr, shell=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + stdin=pstdin) of = pipe.stdout.fileno() ef = pipe.stderr.fileno() while True: -- cgit v1.2.1