tests/run-tests.py
branchstable
changeset 947 23f0eeb598b5
parent 946 b6a39effa432
child 951 0af8a73dfe14
equal deleted inserted replaced
946:b6a39effa432 947:23f0eeb598b5
    58 processlock = threading.Lock()
    58 processlock = threading.Lock()
    59 
    59 
    60 closefds = os.name == 'posix'
    60 closefds = os.name == 'posix'
    61 def Popen4(cmd, wd, timeout):
    61 def Popen4(cmd, wd, timeout):
    62     processlock.acquire()
    62     processlock.acquire()
    63     orig = os.getcwd()
    63     p = subprocess.Popen(cmd, shell=True, bufsize=-1, cwd=wd,
    64     os.chdir(wd)
       
    65     p = subprocess.Popen(cmd, shell=True, bufsize=-1,
       
    66                          close_fds=closefds,
    64                          close_fds=closefds,
    67                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
    65                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
    68                          stderr=subprocess.STDOUT)
    66                          stderr=subprocess.STDOUT)
    69     os.chdir(orig)
       
    70     processlock.release()
    67     processlock.release()
    71 
    68 
    72     p.fromchild = p.stdout
    69     p.fromchild = p.stdout
    73     p.tochild = p.stdin
    70     p.tochild = p.stdin
    74     p.childerr = p.stderr
    71     p.childerr = p.stderr