Fix zipfile handling

This commit is contained in:
Matthias 2019-08-25 14:30:02 +02:00
parent 6e952a0aa8
commit 06024b0ab0
1 changed files with 4 additions and 2 deletions

View File

@ -72,8 +72,10 @@ def json_load(datafile: IO):
def file_load_json(file):
gzipfile = file.with_suffix(file.suffix + '.gz')
if file.suffix != ".gz":
gzipfile = file.with_suffix(file.suffix + '.gz')
else:
gzipfile = file
# Try gzip file first, otherwise regular json file.
if gzipfile.is_file():
logger.debug('Loading ticker data from file %s', gzipfile)