Use exists instead of is_file

This commit is contained in:
Matthias 2019-12-27 11:08:47 +01:00
parent a3144cb2f0
commit 8a030e7fc0

View File

@ -65,7 +65,7 @@ class JsonDataHandler(IDataHandler):
:return: DataFrame with ohlcv data, or empty DataFrame
"""
filename = self._pair_data_filename(self._datadir, pair, timeframe)
if not filename.is_file():
if not filename.exists():
return DataFrame(columns=self._columns)
pairdata = read_json(filename, orient='values')
pairdata.columns = self._columns
@ -149,7 +149,7 @@ class JsonDataHandler(IDataHandler):
:return: True when deleted, false if file did not exist.
"""
filename = self._pair_trades_filename(self._datadir, pair)
if filename.is_file():
if filename.exists():
filename.unlink()
return True
return False