changeset 34071:f55769e41803

py3: use bytes[n:n + 1] to get bytes in templater._parsetemplate()
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 17:37:17 +0900
parents 01c9700fbf9f
children 30535fe47e78
files mercurial/templater.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 '\\{')