def validate_int(s):
 try:
  return int(s)
 except ValueError:
  raise ValueError(('Could not convert "%s" to int' % s))

def validate_int ( s ) : try : return int ( s ) except ValueError : raise ValueError ( ( 'Could not convert "%s" to int' % s ) )
convert s to int or raise .