Make strtobool even more robust
If strtobool fails, return False always.
This commit is contained in:
parent
d36d8e0637
commit
ca5327b908
|
@ -50,7 +50,10 @@ def strtobool(stringv):
|
|||
return False
|
||||
if isinstance(stringv, bool):
|
||||
return bool(stringv)
|
||||
try:
|
||||
return bool(dustrtobool(stringv))
|
||||
except:
|
||||
return False
|
||||
|
||||
# Parse the configuration file
|
||||
try:
|
||||
|
|
|
@ -38,7 +38,10 @@ def strtobool(stringv):
|
|||
return False
|
||||
if isinstance(stringv, bool):
|
||||
return bool(stringv)
|
||||
try:
|
||||
return bool(dustrtobool(stringv))
|
||||
except:
|
||||
return False
|
||||
|
||||
#
|
||||
# Initialization function
|
||||
|
|
|
@ -47,7 +47,10 @@ def strtobool(stringv):
|
|||
return False
|
||||
if isinstance(stringv, bool):
|
||||
return bool(stringv)
|
||||
try:
|
||||
return bool(dustrtobool(stringv))
|
||||
except:
|
||||
return False
|
||||
|
||||
#
|
||||
# Exceptions (used by Celery tasks)
|
||||
|
|
Loading…
Reference in New Issue