diff mercurial/parser.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 089e37802fb3
children a98540ea1e42
line wrap: on
line diff
--- a/mercurial/parser.py	Sat Mar 18 12:27:52 2017 -0400
+++ b/mercurial/parser.py	Fri Mar 17 23:42:46 2017 +0900
@@ -19,7 +19,10 @@
 from __future__ import absolute_import
 
 from .i18n import _
-from . import error
+from . import (
+    error,
+    util,
+)
 
 class parser(object):
     def __init__(self, elements, methods=None):
@@ -164,7 +167,7 @@
 
 def unescapestr(s):
     try:
-        return s.decode("string_escape")
+        return util.unescapestr(s)
     except ValueError as e:
         # mangle Python's exception into our format
         raise error.ParseError(str(e).lower())