comparison mercurial/profiling.py @ 30322:189a1030affb

profiling: obtain stderr from ui This will help Python 3 porting.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 20 Oct 2016 22:07:03 +0900
parents 3fd53cc1aad8
children 69acfd2ca11e
comparison
equal deleted inserted replaced
30318:e1d6aa0e4c3a 30322:189a1030affb
7 7
8 from __future__ import absolute_import, print_function 8 from __future__ import absolute_import, print_function
9 9
10 import contextlib 10 import contextlib
11 import os 11 import os
12 import sys
13 import time 12 import time
14 13
15 from .i18n import _ 14 from .i18n import _
16 from . import ( 15 from . import (
17 error, 16 error,
134 fp = util.stringio() 133 fp = util.stringio()
135 elif output: 134 elif output:
136 path = ui.expandpath(output) 135 path = ui.expandpath(output)
137 fp = open(path, 'wb') 136 fp = open(path, 'wb')
138 else: 137 else:
139 fp = sys.stderr 138 fp = ui.ferr
140 139
141 try: 140 try:
142 if profiler == 'ls': 141 if profiler == 'ls':
143 proffn = lsprofile 142 proffn = lsprofile
144 elif profiler == 'flame': 143 elif profiler == 'flame':