mirror of https://github.com/aristocratos/bpytop
refactor: Pep8 recommendations
parent
e9ca00574e
commit
643bc357fc
|
@ -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}")
|
||||
|
||||
|
|
Loading…
Reference in New Issue