Mercurial > hg
diff mercurial/profiling.py @ 30664:69acfd2ca11e
py3: replace os.getenv with pycompat.osgetenv
os.getenv deals with unicodes on Python 3, so we have pycompat.osgetenv to
deal with bytes. This patch replaces occurrences on os.getenv with
pycompat.osgetenv
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 19 Dec 2016 02:54:49 +0530 |
parents | 189a1030affb |
children | 6a70cf94d1b5 |
line wrap: on
line diff
--- a/mercurial/profiling.py Mon Dec 19 02:35:38 2016 +0530 +++ b/mercurial/profiling.py Mon Dec 19 02:54:49 2016 +0530 @@ -8,12 +8,12 @@ from __future__ import absolute_import, print_function import contextlib -import os import time from .i18n import _ from . import ( 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 = os.getenv('HGPROF') + profiler = pycompat.osgetenv('HGPROF') if profiler is None: profiler = ui.config('profiling', 'type', default='stat') if profiler not in ('ls', 'stat', 'flame'):