From: Zac Medico Date: Fri, 18 May 2007 17:48:07 +0000 (-0000) Subject: Catch a potential OSError if the child process has already died. X-Git-Tag: v2.2_pre1~1415 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1525f848f2670a04b3069d5ff9620a1a868a4fcd;p=portage.git Catch a potential OSError if the child process has already died. svn path=/main/trunk/; revision=6550 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 9b9fbdcb6..f58438158 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2341,7 +2341,10 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, **keyw if input_pid: # cat is blocking on stdin, so it must be killed. import signal - os.kill(input_pid, signal.SIGTERM) + try: + os.kill(input_pid, signal.SIGTERM) + except OSError: + pass # it died by itself os.waitpid(input_pid, 0) portage.process.spawned_pids.remove(input_pid) pid = mypids[-1]