When a previous call to poll() has already seen the process status,
wait() should not call waitpid() again. Should be backported to 2.2.4.
This commit is contained in:
parent
bf68c78a6f
commit
3800ef7ae2
|
@ -83,10 +83,11 @@ class Popen3:
|
||||||
|
|
||||||
def wait(self):
|
def wait(self):
|
||||||
"""Wait for and return the exit status of the child process."""
|
"""Wait for and return the exit status of the child process."""
|
||||||
pid, sts = os.waitpid(self.pid, 0)
|
if self.sts < 0:
|
||||||
if pid == self.pid:
|
pid, sts = os.waitpid(self.pid, 0)
|
||||||
self.sts = sts
|
if pid == self.pid:
|
||||||
_active.remove(self)
|
self.sts = sts
|
||||||
|
_active.remove(self)
|
||||||
return self.sts
|
return self.sts
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue