mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 17:42:42 +08:00
BUG: Fix check for cached public data for Python 2.7
Python 2 and 3 throw different exception types when a file does not exist. Catch both exception types to trigger the download, so that the loader works under both Python versions.
This commit is contained in:
@@ -158,7 +158,7 @@ def load_market_data(bm_symbol='^GSPC'):
|
||||
bm_filepath = get_data_filepath(get_benchmark_filename(bm_symbol))
|
||||
try:
|
||||
saved_benchmarks = pd.Series.from_csv(bm_filepath)
|
||||
except OSError:
|
||||
except (OSError, IOError):
|
||||
print("""
|
||||
data files aren't distributed with source.
|
||||
Fetching data from Yahoo Finance.
|
||||
@@ -205,7 +205,7 @@ Fetching data from Yahoo Finance.
|
||||
tr_filepath = get_data_filepath(filename)
|
||||
try:
|
||||
saved_curves = pd.DataFrame.from_csv(tr_filepath)
|
||||
except OSError:
|
||||
except (OSError, IOError):
|
||||
print("""
|
||||
data files aren't distributed with source.
|
||||
Fetching data from {0}
|
||||
|
||||
Reference in New Issue
Block a user