CleanDecimal: do not crash with inputs like NotAvailable

This commit is contained in:
Laurent Bachelier 2014-08-29 15:03:09 +02:00
commit 59095aa85e

View file

@ -311,7 +311,10 @@ class CleanDecimal(CleanText):
self.replace_dots = replace_dots
def filter(self, text):
text = super(CleanDecimal, self).filter(text)
if empty(text) or text == '':
return self.default_or_raise(ParseError('Unable to parse %r' % text))
else:
text = super(CleanDecimal, self).filter(text)
if self.replace_dots:
if type(self.replace_dots) is tuple:
thousands_sep, decimal_sep = self.replace_dots