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

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

pym/portage.py

index 00799161584cfa76090e41904f937f16d2f171bb..29671a5db1d350d016b7ce7aeab986070bc2679e 100644 (file)
@@ -2737,7 +2737,11 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
 
        fd_pipes = keywords.get("fd_pipes")
        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(),
+               }
        # In some cases the above print statements don't flush stdout, so
        # it needs to be flushed before allowing a child process to use it
        # so that output always shows in the correct order.