MergeProcess: inherit stdin for use with pdb
authorZac Medico <zmedico@gentoo.org>
Wed, 15 Feb 2012 22:28:41 +0000 (14:28 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 15 Feb 2012 22:28:41 +0000 (14:28 -0800)
pym/portage/dbapi/_MergeProcess.py

index 1747a098bcf37e9f02dbb84897d25a0d8d33896d..21d43dd839932e9d01d2a7f5805f9ee4ffbb3af7 100644 (file)
@@ -4,6 +4,7 @@
 import io
 import platform
 import signal
+import sys
 import traceback
 
 import errno
@@ -40,6 +41,12 @@ class MergeProcess(SpawnProcess):
                        settings.reset()
                        settings.setcpv(cpv, mydb=self.mydbapi)
 
+               # Inherit stdin by default, so that the pdb SIGUSR1
+               # handler is usable for the subprocess.
+               if self.fd_pipes is None:
+                       self.fd_pipes = {}
+               self.fd_pipes.setdefault(0, sys.stdin.fileno())
+
                super(MergeProcess, self)._start()
 
        def _lock_vdb(self):