equal
deleted
inserted
replaced
633 # chg since the parent process won't die anytime soon. |
633 # chg since the parent process won't die anytime soon. |
634 # We use a thread to make the overhead tiny. |
634 # We use a thread to make the overhead tiny. |
635 def _do_wait(): |
635 def _do_wait(): |
636 os.waitpid(pid, 0) |
636 os.waitpid(pid, 0) |
637 |
637 |
638 threading.Thread(target=_do_wait, daemon=True).start() |
638 t = threading.Thread(target=_do_wait) |
|
639 t.daemon = True |
|
640 t.start() |
639 return |
641 return |
640 # Parent process |
642 # Parent process |
641 (_pid, status) = os.waitpid(pid, 0) |
643 (_pid, status) = os.waitpid(pid, 0) |
642 if os.WIFEXITED(status): |
644 if os.WIFEXITED(status): |
643 returncode = os.WEXITSTATUS(status) |
645 returncode = os.WEXITSTATUS(status) |