Submitter | Gregory Szorc |
---|---|
Date | Dec. 31, 2014, 10:45 p.m. |
Message ID | <18172660090c5794d147.1420065931@gps-mbp.local> |
Download | mbox | patch |
Permalink | /patch/7286/ |
State | Accepted |
Commit | ae5447de4c1100661fdff69397f70358394da512 |
Headers | show |
Comments
Patch
diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py --- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -207,8 +207,10 @@ def json(obj): out = [] 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__) def _uescape(c):