py3: use pycompat.bytestr() instead of str()
This is because str() on python 3 return unicodes
--- a/mercurial/templatefilters.py Thu Apr 20 19:51:37 2017 +0530
+++ b/mercurial/templatefilters.py Thu Apr 27 09:49:57 2017 +0530
@@ -230,7 +230,7 @@
elif obj is True:
return 'true'
elif isinstance(obj, (int, long, float)):
- return str(obj)
+ return pycompat.bytestr(obj)
elif isinstance(obj, str):
return '"%s"' % encoding.jsonescape(obj, paranoid=paranoid)
elif util.safehasattr(obj, 'keys'):
@@ -359,7 +359,7 @@
return "".join([stringify(t) for t in thing if t is not None])
if thing is None:
return ""
- return str(thing)
+ return pycompat.bytestr(thing)
@templatefilter('stripdir')
def stripdir(text):