diff mercurial/statprof.py @ 31074:2912b06905dc

py3: use pycompat.fsencode() to convert __file__ to bytes __file__ returns unicodes on Python 3. This patch uses pycompat.fsencode() to convert them to bytes.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 20 Feb 2017 18:40:42 +0530
parents cb440e7af05d
children bd872f64a8ba
line wrap: on
line diff
--- a/mercurial/statprof.py	Wed Feb 22 10:14:18 2017 -0800
+++ b/mercurial/statprof.py	Mon Feb 20 18:40:42 2017 +0530
@@ -724,7 +724,7 @@
 
     if path in _pathcache:
         return _pathcache[path]
-    hgpath = encoding.__file__.rsplit(os.sep, 2)[0]
+    hgpath = pycompat.fsencode(encoding.__file__).rsplit(os.sep, 2)[0]
     for p in [hgpath] + sys.path:
         prefix = p + os.sep
         if path.startswith(prefix):