Show More
@@ -318,9 +318,12 b' def evalboolean(context, mapping, arg):' | |||||
318 | return bool(stringify(thing)) |
|
318 | return bool(stringify(thing)) | |
319 |
|
319 | |||
320 | def evalinteger(context, mapping, arg, err=None): |
|
320 | def evalinteger(context, mapping, arg, err=None): | |
321 |
|
|
321 | return unwrapinteger(evalrawexp(context, mapping, arg), err) | |
|
322 | ||||
|
323 | def unwrapinteger(thing, err=None): | |||
|
324 | thing = _unwrapvalue(thing) | |||
322 | try: |
|
325 | try: | |
323 |
return int( |
|
326 | return int(thing) | |
324 | except (TypeError, ValueError): |
|
327 | except (TypeError, ValueError): | |
325 | raise error.ParseError(err or _('not an integer')) |
|
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