# HG changeset patch # User Yuya Nishihara # Date 1491101209 -32400 # Node ID fd687ec5a643fc0842584e37b3d31d60d6d55d3f # Parent ac69675fff1caacf143ab7f0bda668e6e325670a templatefilters: drop callable support from json() This backs out ae5447de4c11. A callable should be evaluated beforehand by templater.runsymbol(). diff -r ac69675fff1c -r fd687ec5a643 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__)