summaryrefslogtreecommitdiffstats
path: root/pym/portage/getbinpkg.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-08-22 12:46:04 -0700
committerZac Medico <zmedico@gentoo.org>2012-08-22 12:46:04 -0700
commit77cb4022c981c3c6ba96533a55058a643f60d334 (patch)
treeeb387d63ef2dc7f354fef7cb5f4867f4ddcbcb2f /pym/portage/getbinpkg.py
parent7a55f93d76bab41f025b77fc4e356d6a5b4b9385 (diff)
downloadportage-77cb4022c981c3c6ba96533a55058a643f60d334.tar.gz
portage-77cb4022c981c3c6ba96533a55058a643f60d334.tar.bz2
portage-77cb4022c981c3c6ba96533a55058a643f60d334.zip
Use sys.__std*.fileno() in case of overrides.
This fixes AttributeError exceptions for API consumers that override sys.std* streams pseudo-file objects.
Diffstat (limited to 'pym/portage/getbinpkg.py')
-rw-r--r--pym/portage/getbinpkg.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py
index 212f78889..34a5e0efe 100644
--- a/pym/portage/getbinpkg.py
+++ b/pym/portage/getbinpkg.py
@@ -466,10 +466,12 @@ def file_get(baseurl,dest,conn=None,fcmd=None,filename=None):
myfetch = portage.util.shlex_split(fcmd)
myfetch = [varexpand(x, mydict=variables) for x in myfetch]
fd_pipes= {
- 0:sys.stdin.fileno(),
- 1:sys.stdout.fileno(),
- 2:sys.stdout.fileno()
+ 0:sys.__stdin__.fileno(),
+ 1:sys.__stdout__.fileno(),
+ 2:sys.__stdout__.fileno()
}
+ sys.__stdout__.flush()
+ sys.__stderr__.flush()
retval = spawn(myfetch, env=os.environ.copy(), fd_pipes=fd_pipes)
if retval != os.EX_OK:
sys.stderr.write(_("Fetcher exited with a failure condition.\n"))