import-scripts: fix boolean rendering (#246)

This commit is contained in:
Naïm Favier 2020-12-07 08:48:48 +01:00 committed by GitHub
parent 27ff900fc3
commit ba3fe60808
Failed to generate hash of commit

View file

@ -540,13 +540,13 @@ def get_options(evaluation):
if value is None: if value is None:
return "null" return "null"
elif isinstance(value, int) or isinstance(value, float): elif type(value) in [int, float]:
return str(value) return str(value)
elif isinstance(value, bool): elif type(value) == bool:
return "true" if value else "false" return "true" if value else "false"
elif isinstance(value, list) and not value: elif type(value) == list and not value:
return "[ ]" return "[ ]"
elif isinstance(value, dict) and not value: elif type(value) == dict and not value:
return "{ }" return "{ }"
else: else:
return jsonToNix(json.dumps(value)) return jsonToNix(json.dumps(value))