Mercurial > hg
comparison mercurial/templater.py @ 14943:d3bb825ddae3
globally: use safehasattr(x, '__call__') instead of hasattr(x, '__call__')
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 16:24:37 -0500 |
parents | 4a28cb4df1f8 |
children | e2c413bde8a5 |
comparison
equal
deleted
inserted
replaced
14942:5b072d4b62f2 | 14943:d3bb825ddae3 |
---|---|
133 | 133 |
134 def runsymbol(context, mapping, key): | 134 def runsymbol(context, mapping, key): |
135 v = mapping.get(key) | 135 v = mapping.get(key) |
136 if v is None: | 136 if v is None: |
137 v = context._defaults.get(key, '') | 137 v = context._defaults.get(key, '') |
138 if hasattr(v, '__call__'): | 138 if util.safehasattr(v, '__call__'): |
139 return v(**mapping) | 139 return v(**mapping) |
140 return v | 140 return v |
141 | 141 |
142 def buildfilter(exp, context): | 142 def buildfilter(exp, context): |
143 func, data = compileexp(exp[1], context) | 143 func, data = compileexp(exp[1], context) |