templatefilters: drop callable support from json()
authorYuya Nishihara <yuya@tcha.org>
Sun, 02 Apr 2017 11:46:49 +0900
changeset 31782 fd687ec5a643
parent 31781 ac69675fff1c
child 31783 8d9eafe01111
templatefilters: drop callable support from json() This backs out ae5447de4c11. A callable should be evaluated beforehand by templater.runsymbol().
mercurial/templatefilters.py
--- a/mercurial/templatefilters.py	Wed Mar 29 21:43:38 2017 +0900
+++ b/mercurial/templatefilters.py	Sun Apr 02 11:46:49 2017 +0900
@@ -236,8 +236,6 @@
         for i in obj:
             out.append(json(i))
         return '[' + ', '.join(out) + ']'
-    elif util.safehasattr(obj, '__call__'):
-        return json(obj())
     else:
         raise TypeError('cannot encode type %s' % obj.__class__.__name__)