mirror of https://github.com/MISP/PyMISP
chg: Orders of tests in make_bool
parent
97b159e88c
commit
f53690f406
|
@ -90,11 +90,10 @@ def _int_to_str(d):
|
||||||
def make_bool(value):
|
def make_bool(value):
|
||||||
if isinstance(value, bool):
|
if isinstance(value, bool):
|
||||||
return value
|
return value
|
||||||
if not value: # None, 0, '', {}, []
|
|
||||||
return False
|
|
||||||
|
|
||||||
if isinstance(value, int):
|
if isinstance(value, int):
|
||||||
return bool(value)
|
return bool(value)
|
||||||
|
if not value: # None, 0, '', {}, []
|
||||||
|
return False
|
||||||
|
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
if value == '0':
|
if value == '0':
|
||||||
|
|
Loading…
Reference in New Issue