In portage.process.spawn(), make the default fd_pipes value get
authorZac Medico <zmedico@gentoo.org>
Fri, 21 Dec 2007 02:21:07 +0000 (02:21 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 Dec 2007 02:21:07 +0000 (02:21 -0000)
file descriptors from sys.std{in,out,err} so that they can be
overridden. (trunk r9018)

svn path=/main/branches/2.1.2/; revision=9019

pym/portage_exec.py

index 3a53661bbfc2826a6ee55f7840db23789fa9652d..dd8217dc31491c1d9304575269aacde2ed455ac8 100644 (file)
@@ -181,7 +181,11 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False,
        # If we haven't been told what file descriptors to use
        # default to propogating our stdin, stdout and stderr.
        if fd_pipes is None:
-               fd_pipes = {0:0, 1:1, 2:2}
+               fd_pipes = {
+                       0:sys.stdin.fileno(),
+                       1:sys.stdout.fileno(),
+                       2:sys.stderr.fileno(),
+               }
 
        # mypids will hold the pids of all processes created.
        mypids = []