wmlunits: Handle TypeError on int_fallback() (in particular to deal with None)

This commit is contained in:
Ignacio R. Morelle 2017-08-12 22:22:57 -04:00
parent 0f171cd364
commit 3746925eab

View file

@ -171,6 +171,8 @@ def reset_errors():
def int_fallback(str_value, int_fallback=0):
try:
return int(str_value)
except TypeError:
return int_fallback
except ValueError:
return int_fallback