diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-08-22 12:46:04 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-08-22 12:46:04 -0700 |
commit | 77cb4022c981c3c6ba96533a55058a643f60d334 (patch) | |
tree | eb387d63ef2dc7f354fef7cb5f4867f4ddcbcb2f /pym/portage/package/ebuild/doebuild.py | |
parent | 7a55f93d76bab41f025b77fc4e356d6a5b4b9385 (diff) | |
download | portage-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/package/ebuild/doebuild.py')
-rw-r--r-- | pym/portage/package/ebuild/doebuild.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 395e0eeec..ef51da1b4 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -690,9 +690,9 @@ def doebuild(myebuild, mydo, _unused=None, settings=None, debug=0, listonly=0, mysettings["dbkey"] = "" pr, pw = os.pipe() fd_pipes = { - 0:sys.stdin.fileno(), - 1:sys.stdout.fileno(), - 2:sys.stderr.fileno(), + 0:sys.__stdin__.fileno(), + 1:sys.__stdout__.fileno(), + 2:sys.__stderr__.fileno(), 9:pw} mypids = _spawn_phase(mydo, mysettings, returnpid=True, fd_pipes=fd_pipes) @@ -1367,18 +1367,18 @@ 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:sys.stdin.fileno(), - 1:sys.stdout.fileno(), - 2:sys.stderr.fileno(), + 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. - stdout_filenos = (sys.stdout.fileno(), sys.stderr.fileno()) + stdout_filenos = (sys.__stdout__.fileno(), sys.__stderr__.fileno()) for fd in fd_pipes.values(): if fd in stdout_filenos: - sys.stdout.flush() - sys.stderr.flush() + sys.__stdout__.flush() + sys.__stderr__.flush() break features = mysettings.features |