EbuildFetcher: use default SIGINT/TERM handlers
authorZac Medico <zmedico@gentoo.org>
Tue, 1 Feb 2011 04:33:48 +0000 (20:33 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 2 Feb 2011 23:26:48 +0000 (15:26 -0800)
This seems to fix bug #353239.

pym/_emerge/EbuildFetcher.py

index d19307806e2b0903ed06c3ea1f6cf63efbe016b2..eb27647d18be9545dc9b3305667f5502e07de64d 100644 (file)
@@ -5,6 +5,7 @@ import traceback
 
 from _emerge.SpawnProcess import SpawnProcess
 import copy
+import signal
 import sys
 import portage
 from portage import os
@@ -95,6 +96,11 @@ class EbuildFetcher(SpawnProcess):
 
                portage.process._setup_pipes(fd_pipes)
 
+               # Use default signal handlers in order to avoid problems
+               # killing subprocesses as reported in bug #353239.
+               signal.signal(signal.SIGINT, signal.SIG_DFL)
+               signal.signal(signal.SIGTERM, signal.SIG_DFL)
+
                # Force consistent color output, in case we are capturing fetch
                # output through a normal pipe due to unavailability of ptys.
                portage.output.havecolor = self._settings.get('NOCOLOR') \