mirror of https://github.com/aristocratos/bpytop
refactor: Pep8 recommendations
parent
e9ca00574e
commit
643bc357fc
|
@ -415,12 +415,12 @@ def strtobool(val: str) -> bool:
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
val = val.lower()
|
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'):
|
if val in ('y', 'yes', 't', 'true', 'on', '1'):
|
||||||
return True
|
return True
|
||||||
elif val in ('n', 'no', 'f', 'false', 'off', '0'):
|
elif val in ('n', 'no', 'f', 'false', 'off', '0'):
|
||||||
return False
|
return False
|
||||||
except:
|
|
||||||
raise ValueError(f"invalid type {type(val)} for truth value {val}")
|
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"invalid truth value {val}")
|
raise ValueError(f"invalid truth value {val}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue