diff mercurial/statprof.py @ 30642:344e68882cd3

py3: replace os.environ with encoding.environ (part 4 of 5)
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 18 Dec 2016 02:06:00 +0530
parents c6ce11f2ee50
children 262c2be8ea5a
line wrap: on
line diff
--- a/mercurial/statprof.py	Sun Dec 18 01:54:36 2016 +0530
+++ b/mercurial/statprof.py	Sun Dec 18 02:06:00 2016 +0530
@@ -117,6 +117,7 @@
 import time
 
 from . import (
+    encoding,
     pycompat,
 )
 
@@ -324,7 +325,7 @@
 
         state.accumulate_time(clock())
         state.last_start_time = None
-        statprofpath = os.environ.get('STATPROF_DEST')
+        statprofpath = encoding.environ.get('STATPROF_DEST')
         if statprofpath:
             save_data(statprofpath)
 
@@ -680,7 +681,7 @@
 
 def write_to_flame(data, fp, scriptpath=None, outputfile=None, **kwargs):
     if scriptpath is None:
-        scriptpath = os.environ['HOME'] + '/flamegraph.pl'
+        scriptpath = encoding.environ['HOME'] + '/flamegraph.pl'
     if not os.path.exists(scriptpath):
         print("error: missing %s" % scriptpath, file=fp)
         print("get it here: https://github.com/brendangregg/FlameGraph",