py3: use bytes[n:n + 1] to get bytes in templater._parsetemplate()
authorYuya Nishihara <yuya@tcha.org>
Sun, 03 Sep 2017 17:37:17 +0900
changeset 34071 f55769e41803
parent 34070 01c9700fbf9f
child 34072 30535fe47e78
py3: use bytes[n:n + 1] to get bytes in templater._parsetemplate()
mercurial/templater.py
--- a/mercurial/templater.py	Sun Sep 03 17:14:53 2017 +0900
+++ b/mercurial/templater.py	Sun Sep 03 17:37:17 2017 +0900
@@ -169,7 +169,7 @@
             parsed.append(('string', parser.unescapestr(tmpl[pos:stop])))
             pos = stop
             break
-        c = tmpl[n]
+        c = tmpl[n:n + 1]
         bs = (n - pos) - len(tmpl[pos:n].rstrip('\\'))
         if bs % 2 == 1:
             # escaped (e.g. '\{', '\\\{', but not '\\{')