CleanDecimal: do not crash with inputs like NotAvailable
This commit is contained in:
parent
a9be0e00bb
commit
59095aa85e
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue