[PATCH 1 of 4] profiling: obtain stderr from ui

Yuya Nishihara yuya at tcha.org
Tue Nov 8 09:47:25 EST 2016


# HG changeset patch
# User Yuya Nishihara <yuya at 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.

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':


More information about the Mercurial-devel mailing list