diff mercurial/extensions.py @ 31456:067add650129

encoding: factor out unicode variants of from/tolocal() Unfortunately, these functions will be commonly used on Python 3.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 13 Mar 2017 09:11:08 -0700
parents 90f439823b99
children 6419cd243017
line wrap: on
line diff
--- a/mercurial/extensions.py	Mon Mar 13 08:53:31 2017 -0700
+++ b/mercurial/extensions.py	Mon Mar 13 09:11:08 2017 -0700
@@ -109,7 +109,7 @@
     """Portably format an import error into a form suitable for
     %-formatting into bytestrings."""
     if pycompat.ispy3:
-        return encoding.tolocal(str(inst).encode('utf-8'))
+        return encoding.unitolocal(str(inst))
     return inst
 
 def _reportimporterror(ui, err, failed, next):