# HG changeset patch # User Augie Fackler # Date 2011-07-25 21:02:42 # Node ID 376091a4ad23c658cb2ae8b5b85bd16fbbfe68a6 # Parent 0588fb0e2e8dfa4ddff6df91f496a3cb06db3676 templatefilters: use safehasattr instead of hasattr diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py --- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -188,7 +188,7 @@ def json(obj): return '"%s"' % jsonescape(u) elif isinstance(obj, unicode): return '"%s"' % jsonescape(obj) - elif hasattr(obj, 'keys'): + elif util.safehasattr(obj, 'keys'): out = [] for k, v in obj.iteritems(): s = '%s: %s' % (json(k), json(v))