changeset 31782:fd687ec5a643

templatefilters: drop callable support from json() This backs out ae5447de4c11. A callable should be evaluated beforehand by templater.runsymbol().
author Yuya Nishihara <yuya@tcha.org>
date Sun, 02 Apr 2017 11:46:49 +0900
parents ac69675fff1c
children 8d9eafe01111
files mercurial/templatefilters.py
diffstat 1 files changed, 0 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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__)