refactor: Pep8 recommendations

pull/372/head
Rodrigo Cristiano 2021-12-22 14:41:18 -03:00
parent e9ca00574e
commit 643bc357fc
1 changed files with 5 additions and 5 deletions

View File

@ -415,12 +415,12 @@ def strtobool(val: str) -> bool:
"""
try:
val = val.lower()
except AttributeError:
raise ValueError(f"invalid type {type(val)} for truth value {val}")
if val in ('y', 'yes', 't', 'true', 'on', '1'):
return True
elif val in ('n', 'no', 'f', 'false', 'off', '0'):
return False
except:
raise ValueError(f"invalid type {type(val)} for truth value {val}")
else:
raise ValueError(f"invalid truth value {val}")