Remove the class StdoutAnnotated and clones the object instead.
The end goal is to remove options.stdout, to remove a lot of bookkeeping.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3418014
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59792 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient.py b/gclient.py
index 9eec5d8..d1b7e4a 100644
--- a/gclient.py
+++ b/gclient.py
@@ -1170,6 +1170,10 @@
"""Doesn't parse the arguments here, just find the right subcommand to
execute."""
try:
+ # Make stdout auto-flush so buildbot doesn't kill us during lengthy
+ # operations. Python as a strong tendency to buffer sys.stdout.
+ sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
+
# Do it late so all commands are listed.
CMDhelp.usage = ('\n\nCommands are:\n' + '\n'.join([
' %-10s %s' % (fn[3:], Command(fn[3:]).__doc__.split('\n')[0].strip())
@@ -1198,8 +1202,8 @@
options.entries_filename = options.config_filename + '_entries'
if options.jobs < 1:
parser.error('--jobs must be 1 or higher')
- # Always autoflush so buildbot doesn't kill us during lengthy operations.
- options.stdout = gclient_utils.StdoutAutoFlush(sys.stdout)
+ # TODO(maruel): Temporary, to be removed.
+ options.stdout = sys.stdout
# These hacks need to die.
if not hasattr(options, 'revisions'):