[PATCH 5 of 5] run-tests: use subprocess.Popen on all systems

Simon Heimberg simohe at besonet.ch
Tue Feb 8 00:56:03 CST 2011


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1296593286 -3600
# Node ID 41b708fd0aa6167ac264846ff2141f61a1cf5904
# Parent  797b0e0c0d239e78439b373e5e388ec32cddb039
run-tests: use subprocess.Popen on all systems

diff -r 797b0e0c0d23 -r 41b708fd0aa6 tests/run-tests.py
--- a/tests/run-tests.py	Die Feb 08 07:20:34 2011 +0100
+++ b/tests/run-tests.py	Die Feb 01 21:48:06 2011 +0100
@@ -584,19 +584,11 @@
 def run(cmd, options, replacements):
     """Run command in a sub-process, capturing the output (stdout and stderr).
     Return a tuple (exitcode, output).  output is None in debug mode."""
-    # TODO: Use subprocess.Popen if we're running on Python 2.4
     if options.debug:
         proc = subprocess.Popen(cmd, shell=True)
         ret = proc.wait()
         return (ret, None)
 
-    if os.name == 'nt' or sys.platform.startswith('java'):
-        tochild, fromchild = os.popen4(cmd)
-        tochild.close()
-        output = fromchild.read()
-        ret = fromchild.close()
-        if ret is None:
-            ret = 0
     else:
         proc = Popen4(cmd)
         def cleanup():


More information about the Mercurial-devel mailing list