summaryrefslogtreecommitdiff
path: root/Lib/distutils/spawn.py
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-02-24 23:54:17 +0000
committerHye-Shik Chang <hyeshik@gmail.com>2004-02-24 23:54:17 +0000
commit3b10c0c3bb12c651f09690f7e3053cf0860da8b6 (patch)
tree54934ef302524847c87c2d1f67fe2e44db283363 /Lib/distutils/spawn.py
parent6641385cd7d9ea821d0497a525e83adc07be6002 (diff)
downloadcpython-3b10c0c3bb12c651f09690f7e3053cf0860da8b6.tar.gz
Make _spawn_posix be ready for EINTR. waitpid(2) can be interrupted
by SIGCHLD or sth because no signal is masked before. This fixes an optimized installation problem on FreeBSD libpthread.
Diffstat (limited to 'Lib/distutils/spawn.py')
-rw-r--r--Lib/distutils/spawn.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
index 4857ce5e63..67391e8826 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -144,7 +144,14 @@ def _spawn_posix (cmd,
# Loop until the child either exits or is terminated by a signal
# (ie. keep waiting if it's merely stopped)
while 1:
- (pid, status) = os.waitpid(pid, 0)
+ try:
+ (pid, status) = os.waitpid(pid, 0)
+ except OSError, exc:
+ import errno
+ if exc.errno == errno.EINTR:
+ continue
+ raise DistutilsExecError, \
+ "command '%s' failed: %s" % (cmd[0], exc[-1])
if os.WIFSIGNALED(status):
raise DistutilsExecError, \
"command '%s' terminated by signal %d" % \