diff --git a/freqtrade/misc.py b/freqtrade/misc.py index fac379c18..7546dba8f 100644 --- a/freqtrade/misc.py +++ b/freqtrade/misc.py @@ -71,14 +71,14 @@ def file_dump_json(filename, data, is_zip=False) -> None: :param data: JSON Data to save :return: """ - if not is_zip: - with open(filename, 'w') as fp: - json.dump(data, fp, default=str) - else: + if is_zip: if not filename.endswith('.gz'): filename = filename + '.gz' with gzip.open(filename, 'w') as fp: json.dump(data, fp, default=str) + else: + with open(filename, 'w') as fp: + json.dump(data, fp, default=str) def format_ms_time(date: str) -> str: