run-tests: replace chdir() with Popen cwd option stable
authorPatrick Mezard <pmezard@gmail.com>
Mon, 16 May 2011 21:56:26 +0200
branchstable
changeset 947 23f0eeb598b5
parent 946 b6a39effa432
child 948 65b0318770d1
child 949 dd81191ffac3
run-tests: replace chdir() with Popen cwd option [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Mon May 16 21:54:43 2011 +0200
+++ b/tests/run-tests.py	Mon May 16 21:56:26 2011 +0200
@@ -60,13 +60,10 @@
 closefds = os.name == 'posix'
 def Popen4(cmd, wd, timeout):
     processlock.acquire()
-    orig = os.getcwd()
-    os.chdir(wd)
-    p = subprocess.Popen(cmd, shell=True, bufsize=-1,
+    p = subprocess.Popen(cmd, shell=True, bufsize=-1, cwd=wd,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT)
-    os.chdir(orig)
     processlock.release()
 
     p.fromchild = p.stdout