diff -r 897726622877 -r 6a70cf94d1b5 mercurial/profiling.py --- a/mercurial/profiling.py Sun Jan 15 16:33:15 2017 +0900 +++ b/mercurial/profiling.py Sun Jan 15 13:17:05 2017 +0530 @@ -12,8 +12,8 @@ from .i18n import _ from . import ( + encoding, error, - pycompat, util, ) @@ -120,7 +120,7 @@ Profiling is active when the context manager is active. When the context manager exits, profiling results will be written to the configured output. """ - profiler = pycompat.osgetenv('HGPROF') + profiler = encoding.environ.get('HGPROF') if profiler is None: profiler = ui.config('profiling', 'type', default='stat') if profiler not in ('ls', 'stat', 'flame'):