diff mercurial/wireproto.py @ 31460:53865692a354

util: wrap s.encode('string_escape') call for future py3 compatibility
author Yuya Nishihara <yuya@tcha.org>
date Wed, 15 Mar 2017 23:06:50 +0900
parents 16d8bec0177d
children d0d9a4fca59b
line wrap: on
line diff
--- a/mercurial/wireproto.py	Mon Mar 13 09:24:53 2017 -0700
+++ b/mercurial/wireproto.py	Wed Mar 15 23:06:50 2017 +0900
@@ -900,7 +900,7 @@
 def pushkey(repo, proto, namespace, key, old, new):
     # compatibility with pre-1.8 clients which were accidentally
     # sending raw binary nodes rather than utf-8-encoded hex
-    if len(new) == 20 and new.encode('string-escape') != new:
+    if len(new) == 20 and util.escapestr(new) != new:
         # looks like it could be a binary node
         try:
             new.decode('utf-8')