changeset 14967:376091a4ad23

templatefilters: use safehasattr instead of hasattr
author Augie Fackler <durin42@gmail.com>
date Mon, 25 Jul 2011 16:02:42 -0500
parents 0588fb0e2e8d
children b7dbe957585c
files mercurial/templatefilters.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatefilters.py	Mon Jul 25 16:02:27 2011 -0500
+++ b/mercurial/templatefilters.py	Mon Jul 25 16:02:42 2011 -0500
@@ -188,7 +188,7 @@
         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))