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/_emerge/BinpkgFetcher.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/_emerge/BinpkgFetcher.py')
-rw-r--r-- | pym/_emerge/BinpkgFetcher.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py index f415e2ec7..1913b4431 100644 --- a/pym/_emerge/BinpkgFetcher.py +++ b/pym/_emerge/BinpkgFetcher.py @@ -1,4 +1,4 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.AsynchronousLock import AsynchronousLock @@ -91,9 +91,9 @@ class BinpkgFetcher(SpawnProcess): # Redirect all output to stdout since some fetchers like # wget pollute stderr (if portage detects a problem then it # can send it's own message to stderr). - fd_pipes.setdefault(0, sys.stdin.fileno()) - fd_pipes.setdefault(1, sys.stdout.fileno()) - fd_pipes.setdefault(2, sys.stdout.fileno()) + fd_pipes.setdefault(0, sys.__stdin__.fileno()) + fd_pipes.setdefault(1, sys.__stdout__.fileno()) + fd_pipes.setdefault(2, sys.__stdout__.fileno()) self.args = fetch_args self.env = fetch_env @@ -104,7 +104,7 @@ class BinpkgFetcher(SpawnProcess): def _pipe(self, fd_pipes): """When appropriate, use a pty so that fetcher progress bars, like wget has, will work properly.""" - if self.background or not sys.stdout.isatty(): + if self.background or not sys.__stdout__.isatty(): # When the output only goes to a log file, # there's no point in creating a pty. return os.pipe() |