mercurial/sshpeer.py
changeset 38475 67dc32d4e790
parent 37813 58bbd14b0c62
child 38713 27391d74aaa2
--- a/mercurial/sshpeer.py	Tue Jun 26 10:33:52 2018 -0400
+++ b/mercurial/sshpeer.py	Tue Jun 26 10:36:23 2018 -0400
@@ -22,6 +22,7 @@
 )
 from .utils import (
     procutil,
+    stringutil,
 )
 
 def _serverquote(s):
@@ -273,7 +274,7 @@
 
     # Assume version 1 of wire protocol by default.
     protoname = wireprototypes.SSHV1
-    reupgraded = re.compile(b'^upgraded %s (.*)$' % re.escape(token))
+    reupgraded = re.compile(b'^upgraded %s (.*)$' % stringutil.reescape(token))
 
     lines = ['', 'dummy']
     max_noise = 500