Update truthystring to return bool, not given int.

master
voussoir 2018-02-24 23:01:44 -08:00
parent 5f7266c519
commit d653673277
1 changed files with 6 additions and 2 deletions

View File

@ -358,8 +358,12 @@ def truthystring(s):
Case insensitive. Case insensitive.
''' '''
if isinstance(s, (bool, int)) or s is None: if s is None:
return s return None
if isinstance(s, (bool, int)):
return bool(s)
s = s.lower() s = s.lower()
if s in constants.TRUTHYSTRING_TRUE: if s in constants.TRUTHYSTRING_TRUE:
return True return True