summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-21 02:14:46 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-21 02:14:46 +0000
commitf0b59bc706fa993cf467ec2040dd80af0de2930d (patch)
tree9aff57dafc2692634f4d6b782816216464a0395f
parent1b09a3ac99dc2ee5e31c2f0da65b0ea9ccfdee8a (diff)
downloadportage-f0b59bc706fa993cf467ec2040dd80af0de2930d.tar.gz
portage-f0b59bc706fa993cf467ec2040dd80af0de2930d.tar.bz2
portage-f0b59bc706fa993cf467ec2040dd80af0de2930d.zip
In portage.spawn(), make the default fd_pipes value get file
descriptors from sys.std{in,out,err} so that they can be overridden. svn path=/main/trunk/; revision=9016
-rw-r--r--pym/portage/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index a6077c1e4..8587ba3dd 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -2756,7 +2756,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.