diff options
author | Nicolas Vigier <boklm@mageia.org> | 2011-08-17 15:32:16 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2011-08-17 15:32:16 +0000 |
commit | 05733acd4c7a9de98156378045d4e4050cfb65db (patch) | |
tree | 136b50f23155cc076e93f6ed73224f73c5f4a6f7 /MgaRepo | |
parent | 739efd30ba53923ad51f75420a452789909cc324 (diff) | |
download | mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar.gz mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar.bz2 mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.tar.xz mgarepo-05733acd4c7a9de98156378045d4e4050cfb65db.zip |
allow changing stdin when executing command
Diffstat (limited to 'MgaRepo')
-rw-r--r-- | MgaRepo/util.py | 4 |
1 files changed, 3 insertions, 1 deletions
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: |