Safely cast ASFBoolAttributes

* Modify _safe_cast to account for ASFBoolAttributes
This commit is contained in:
Dave Hayes 2013-01-28 14:26:24 -06:00
parent 2f06a508bd
commit db223496d6

View file

@ -108,8 +108,11 @@ def _safe_cast(out_type, val):
return False
else:
try:
# Should work for strings, bools, ints:
return bool(int(val))
if isinstance(val, mutagen.asf.ASFBoolAttribute):
return bool(val)
else:
# Should work for strings, bools, ints:
return bool(int(val))
except ValueError:
return False