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 /bin | |
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 'bin')
-rwxr-xr-x | bin/dispatch-conf | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 139a001e8..35979dbb2 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -1,5 +1,5 @@ #!/usr/bin/python -O -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @@ -463,10 +463,12 @@ if not shell or not os.access(shell, os.EX_OK): def spawn_shell(cmd): if shell: + sys.__stdout__.flush() + sys.__stderr__.flush() spawn([shell, "-c", cmd], env=os.environ, - fd_pipes = { 0 : sys.stdin.fileno(), - 1 : sys.stdout.fileno(), - 2 : sys.stderr.fileno()}) + fd_pipes = { 0 : sys.__stdin__.fileno(), + 1 : sys.__stdout__.fileno(), + 2 : sys.__stderr__.fileno()}) else: os.system(cmd) |