[Pkg-mozext-commits] [adblock-plus] 388/464: Make sure to raise an exception if the subprocess returns a non-zero result code

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:36 UTC 2014


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

taffit pushed a commit to branch master
in repository adblock-plus.

commit 192d36fe3b22a354e338367db788b6f48406e866
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Thu Jul 4 09:40:58 2013 +0200

    Make sure to raise an exception if the subprocess returns a non-zero result code
---
 abp_rewrite.py | 4 +---
 autotest.py    | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/abp_rewrite.py b/abp_rewrite.py
index 3dfc2bc..ad7be1c 100755
--- a/abp_rewrite.py
+++ b/abp_rewrite.py
@@ -20,9 +20,7 @@ def doRewrite(files, args):
     os.path.join(baseDir, 'scripts', 'abprewrite.js'),
     '--arg', ' '.join(args)
   ] + files
-  result, dummy = subprocess.Popen(command, stdout=subprocess.PIPE, env=env).communicate()
-  result = result.replace('\r', '')
-  return result
+  return subprocess.check_output(command, env=env).replace('\r', '')
 
 if __name__ == '__main__':
   try:
diff --git a/autotest.py b/autotest.py
index 6279289..f3e1cef 100755
--- a/autotest.py
+++ b/autotest.py
@@ -35,7 +35,7 @@ def run_tests():
       continue
 
     command = [application, os.path.join(baseDir, 'jshydra.js'), file] + arguments
-    out = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env).communicate()[0].replace('\r', '')
+    out = subprocess.check_output(command, stderr=subprocess.STDOUT, env=env).replace('\r', '')
     expected = open(file + '.expected', 'r').read().replace('\r', '')
     if out == expected:
       print '%s passed' % name

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list