diff mercurial/util.py @ 31457:6419cd243017

encoding: add converter between native str and byte string This kind of encoding conversion is unavoidable on Python 3.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 13 Mar 2017 09:12:56 -0700
parents 067add650129
children 756175623f2e
line wrap: on
line diff
--- a/mercurial/util.py	Mon Mar 13 09:11:08 2017 -0700
+++ b/mercurial/util.py	Mon Mar 13 09:12:56 2017 -0700
@@ -2653,9 +2653,7 @@
         >>> print url(r'file:///D:\data\hg')
         file:///D:\data\hg
         """
-        if pycompat.ispy3:
-            return encoding.unifromlocal(self.__bytes__())
-        return self.__bytes__()
+        return encoding.strfromlocal(self.__bytes__())
 
     def __bytes__(self):
         if self._localpath: