# HG changeset patch # User Patrick Mezard # Date 2011-05-16 19:56:26 # Node ID defa319d8bb7cea6a588e453cd4be4b467af8c47 # Parent ed0bf8e1cd28a29001d4d9ca1edbec6cfd4132b6 run-tests: replace chdir() with Popen cwd option diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -60,13 +60,10 @@ processlock = threading.Lock() 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