##// END OF EJS Templates
templater: extract unwrapinteger() function from evalinteger()
Yuya Nishihara -
r37179:9ab3491f default
parent child Browse files
Show More
@@ -318,9 +318,12 b' def evalboolean(context, mapping, arg):'
318 318 return bool(stringify(thing))
319 319
320 320 def evalinteger(context, mapping, arg, err=None):
321 v = evalfuncarg(context, mapping, arg)
321 return unwrapinteger(evalrawexp(context, mapping, arg), err)
322
323 def unwrapinteger(thing, err=None):
324 thing = _unwrapvalue(thing)
322 325 try:
323 return int(v)
326 return int(thing)
324 327 except (TypeError, ValueError):
325 328 raise error.ParseError(err or _('not an integer'))
326 329
General Comments 0
You need to be logged in to leave comments. Login now