Patchwork [2,of,4] py3: call codecs.escape_decode() directly

login
register
mail settings
Submitter Yuya Nishihara
Date March 17, 2017, 3:25 p.m.
Message ID <49922515f01eae376dcc.1489764348@mimosa>
Download mbox | patch
Permalink /patch/19421/
State Accepted
Headers show

Comments

Yuya Nishihara - March 17, 2017, 3:25 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1489762102 -32400
#      Fri Mar 17 23:48:22 2017 +0900
# Node ID 49922515f01eae376dcc9af7b04d450d301e4782
# Parent  fa032607ed52a0ba605bb4c496426ffb01b09c54
py3: call codecs.escape_decode() directly

The same rule as 3b7a6941a6ef applies.

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2138,7 +2138,7 @@  def escapestr(s):
     return codecs.escape_encode(s)[0]
 
 def unescapestr(s):
-    return s.decode('string_escape')
+    return codecs.escape_decode(s)[0]
 
 def uirepr(s):
     # Avoid double backslash in Windows path repr()