[buildinfo.debian.net] 02/08: Add our own check_output2 wrapper

Chris Lamb chris at chris-lamb.co.uk
Fri Nov 4 11:08:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository buildinfo.debian.net.

commit 4f66b1662f3b4513bc3ea2eb3d684fc9b60fa9b3
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Nov 4 10:58:27 2016 +0000

    Add our own check_output2 wrapper
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 bidb/utils/subprocess.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/bidb/utils/subprocess.py b/bidb/utils/subprocess.py
new file mode 100644
index 0000000..018888e
--- /dev/null
+++ b/bidb/utils/subprocess.py
@@ -0,0 +1,20 @@
+from __future__ import absolute_import
+
+import subprocess
+
+def check_output2(args, stdin=None):
+    p = subprocess.Popen(
+        args,
+        stdout=subprocess.PIPE,
+        stdin=subprocess.PIPE,
+        stderr=subprocess.STDOUT,
+    )
+
+    out, _ = p.communicate(input=stdin)
+
+    retcode = p.wait()
+
+    if retcode:
+        raise subprocess.CalledProcessError(retcode, ' '.join(args), out)
+
+    return out

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/buildinfo.debian.net.git



More information about the Reproducible-commits mailing list