##// END OF EJS Templates
run-tests: replace popen locking with a noop _cleanup handler on py24...
Brendan Cully -
r19415:a0699972 default
parent child Browse files
Show More
@@ -59,15 +59,12 b' import killdaemons as killmod'
59 59 import Queue as queue
60 60
61 61 processlock = threading.Lock()
62 waitlock = threading.Lock()
63 62
64 def waitlocked(fn):
65 def run():
66 waitlock.acquire()
67 ret = fn()
68 waitlock.release()
69 return ret
70 return run
63 # subprocess._cleanup can race with any Popen.wait or Popen.poll on py24
64 # http://bugs.python.org/issue1731717 for details. We shouldn't be producing
65 # zombies but it's pretty harmless even if we do.
66 if sys.version_info[1] < 5:
67 subprocess._cleanup = lambda: None
71 68
72 69 closefds = os.name == 'posix'
73 70 def Popen4(cmd, wd, timeout, env=None):
@@ -76,9 +73,6 b' def Popen4(cmd, wd, timeout, env=None):'
76 73 close_fds=closefds,
77 74 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
78 75 stderr=subprocess.STDOUT)
79 if sys.version_info[1] < 5:
80 p.wait = waitlocked(p.wait)
81 p.poll = waitlocked(p.poll)
82 76 processlock.release()
83 77
84 78 p.fromchild = p.stdout
General Comments 0
You need to be logged in to leave comments. Login now