Brian Kearns  committed 7bf65ca

replace use of commands.getoutput with subprocess.check_output

  • Participants
  • Parent commits fbe59aa

Comments (0)

Files changed (2)

File pypy/doc/test/

 import py
 import pypy
-from commands import getoutput
+from subprocess import check_output
 ROOT = py.path.local(pypy.__file__).dirpath().dirpath()
                       merge() and \
                       branch(default)) and \
               not branch(default)' % (startrev, endrev)
-    cmd = r'hg log -R "%s" -r "%s" --template "{branches}\n"' % (path, revset)
-    out = getoutput(cmd)
+    cmd = ['hg', 'log', '-R', str(path), '-r', revset, '--template', '{branches}\n']
+    out = check_output(cmd)
     branches = set(map(str.strip, out.splitlines()))
     return branches

File pypy/tool/

 import os
 import sys
-import commands
+import subprocess
 if not os.path.isdir('.hg'):
     print 'Must run this script from the top-level directory.'
 def heads():
-    result = commands.getoutput(
-        "hg heads --topo --closed --template '{node|short}:{branches}:{extras}\n'")
+    result = subprocess.check_output(
+        ['hg', 'heads', '--topo', '--closed', '--template', '{node|short}:{branches}:{extras}\n'])
     result = result.splitlines(False)
     result = [s.split(':', 2) for s in result]
     for line in result: