whois/parser.py
changeset 113 bb2f29951cbb
parent 111 ccad96890edd
child 114 f3df17ee0909
equal deleted inserted replaced
111:ccad96890edd 113:bb2f29951cbb
   124         for attr, regex in list(self._regex.items()):
   124         for attr, regex in list(self._regex.items()):
   125             if regex:
   125             if regex:
   126                 values = []
   126                 values = []
   127                 for value in re.findall(regex, self.text, re.IGNORECASE):
   127                 for value in re.findall(regex, self.text, re.IGNORECASE):
   128                     value = value.strip()
   128                     value = value.strip()
   129                     if value and isinstance(value, basestring) and not value.isdigit():
   129                     if value and isinstance(value, basestring) and not value.isdigit() and '_date' in attr:
   130                         # try casting to date format
   130                         # try casting to date format
   131                         value = cast_date(
   131                         value = cast_date(
   132                             value,
   132                             value,
   133                             dayfirst=self.dayfirst,
   133                             dayfirst=self.dayfirst,
   134                             yearfirst=self.yearfirst)
   134                             yearfirst=self.yearfirst)