py3: use pycompat.bytestr() instead of str()
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 27 Apr 2017 09:49:57 +0530
changeset 32127 964e7427a691
parent 32126 e37fd5be0fed
child 32128 c3342c177211
py3: use pycompat.bytestr() instead of str() This is because str() on python 3 return unicodes
mercurial/templatefilters.py
--- 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):