Commit d2462828 authored by Pierre Dittgen's avatar Pierre Dittgen

Harden code to handle non string values

parent 15fe5a78
......@@ -52,9 +52,13 @@ class SumColumnsValue(object):
return val != ''
@staticmethod
def is_int(str_value):
def is_int(value):
""" Return True if the given string contains an integer """
return INT_RE.match(str_value)
if isinstance(value, int):
return True
if isinstance(value, str):
return INT_RE.match(value)
return False
def check_row(self, cells):
""" Main method """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment