def str_to_int(int_str):
 if (int_str is None):
  return None
 int_str = re.sub(u'[,\\.\\+]', u'', int_str)
 return int(int_str)

def str_to_int ( int_str ) : if ( int_str is None ) : return None int_str = re . sub ( u'[,\\.\\+]' , u'' , int_str ) return int ( int_str )
a more relaxed version of int_or_none .