changeset 32180:964e7427a691

py3: use pycompat.bytestr() instead of str() This is because str() on python 3 return unicodes
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 27 Apr 2017 09:49:57 +0530
parents e37fd5be0fed
children c3342c177211
files mercurial/templatefilters.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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):