##// END OF EJS Templates
templater: add try-except stub to runmember()...
Yuya Nishihara -
r38259:ad06a426 default
parent child Browse files
Show More
@@ -666,14 +666,16 b' def runmember(context, mapping, data):'
666 if util.safehasattr(d, 'tomap'):
666 if util.safehasattr(d, 'tomap'):
667 lm = context.overlaymap(mapping, d.tomap())
667 lm = context.overlaymap(mapping, d.tomap())
668 return runsymbol(context, lm, memb)
668 return runsymbol(context, lm, memb)
669 if util.safehasattr(d, 'get'):
669 try:
670 return getdictitem(d, memb)
670 if util.safehasattr(d, 'get'):
671
671 return getdictitem(d, memb)
672 sym = findsymbolicname(darg)
672 raise error.ParseError
673 if sym:
673 except error.ParseError:
674 raise error.ParseError(_("keyword '%s' has no member") % sym)
674 sym = findsymbolicname(darg)
675 else:
675 if sym:
676 raise error.ParseError(_("%r has no member") % pycompat.bytestr(d))
676 raise error.ParseError(_("keyword '%s' has no member") % sym)
677 else:
678 raise error.ParseError(_("%r has no member") % pycompat.bytestr(d))
677
679
678 def runnegate(context, mapping, data):
680 def runnegate(context, mapping, data):
679 data = evalinteger(context, mapping, data,
681 data = evalinteger(context, mapping, data,
General Comments 0
You need to be logged in to leave comments. Login now