diff mercurial/changelog.py @ 31491:afb335353d28

util: wrap s.decode('string_escape') calls for future py3 compatibility
author Yuya Nishihara <yuya@tcha.org>
date Fri, 17 Mar 2017 23:42:46 +0900
parents be520fe3a3e9
children addc392cc3d3
line wrap: on
line diff
--- a/mercurial/changelog.py	Sat Mar 18 12:27:52 2017 -0400
+++ b/mercurial/changelog.py	Fri Mar 17 23:42:46 2017 +0900
@@ -32,7 +32,7 @@
     >>> s
     'ab\\ncd\\\\\\\\n\\x00ab\\rcd\\\\\\n'
     >>> res = _string_escape(s)
-    >>> s == res.decode('string_escape')
+    >>> s == util.unescapestr(res)
     True
     """
     # subset of the string_escape codec
@@ -57,7 +57,7 @@
                 l = l.replace('\\\\', '\\\\\n')
                 l = l.replace('\\0', '\0')
                 l = l.replace('\n', '')
-            k, v = l.decode('string_escape').split(':', 1)
+            k, v = util.unescapestr(l).split(':', 1)
             extra[k] = v
     return extra