Patchwork [1,of,4] profiling: obtain stderr from ui

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 8, 2016, 2:47 p.m.
Message ID <3f64af3f78a8dffe9b24.1478616445@mimosa>
Download mbox | patch
Permalink /patch/17402/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 8, 2016, 2:47 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1476968823 -32400
#      Thu Oct 20 22:07:03 2016 +0900
# Node ID 3f64af3f78a8dffe9b241904fedff33e22d4c8eb
# Parent  0911191dc4c97cbc8334c8b83782e8134bf621f0
profiling: obtain stderr from ui

This will help Python 3 porting.

Patch

diff --git a/mercurial/profiling.py b/mercurial/profiling.py
--- a/mercurial/profiling.py
+++ b/mercurial/profiling.py
@@ -9,7 +9,6 @@  from __future__ import absolute_import, 
 
 import contextlib
 import os
-import sys
 import time
 
 from .i18n import _
@@ -123,7 +122,7 @@  def profile(ui):
         path = ui.expandpath(output)
         fp = open(path, 'wb')
     else:
-        fp = sys.stderr
+        fp = ui.ferr
 
     try:
         if profiler == 'ls':