Commit fc490ffc authored by maruel@chromium.org's avatar maruel@chromium.org

Disable buffering in apply_issue.py to try to find out the problem.

apply_issue step hangs and the output is often in the reverse order. This CL is
to help diagnose the problem.

TBR=cmp@chromium.org
BUG=159868


Review URL: https://chromiumcodereview.appspot.com/11359093

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@166505 0039d316-1c4b-4281-b951-d872f2087c98
parent 32fbac6b
......@@ -25,7 +25,21 @@ import scm
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class Unbuffered(object):
"""Disable buffering on a file object."""
def __init__(self, stream):
self.stream = stream
def write(self, data):
self.stream.write(data)
self.stream.flush()
def __getattr__(self, attr):
return getattr(self.stream, attr)
def main():
sys.stdout = Unbuffered(sys.stdout)
parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
parser.add_option(
'-v', '--verbose', action='count', default=0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment