From ea29c35b23681778f80fe59ee35db4e8c31b6704 Mon Sep 17 00:00:00 2001 From: Pey Lian Lim Date: Mon, 20 Feb 2017 14:25:02 -0500 Subject: [PATCH] Avoid KeyError in RTD build [skip ci] --- pysynphot/locations.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pysynphot/locations.py b/pysynphot/locations.py index 5dba590b..9aa019c7 100644 --- a/pysynphot/locations.py +++ b/pysynphot/locations.py @@ -47,6 +47,7 @@ "crippled.") rootdir = '' +ftp_rootdir = 'ftp://ftp.stsci.edu/cdbs' # Data directory is now installed locally specdir = os.path.join(os.path.dirname(__file__), 'data') @@ -301,8 +302,9 @@ def get_latest_file(template, raise_error=False, err_msg=''): def _refTable(template): - return get_latest_file(os.path.join(os.environ['PYSYN_CDBS'], template), - raise_error=True) + return get_latest_file( + os.path.join(os.environ.get('PYSYN_CDBS', ftp_rootdir), template), + raise_error=True) RedLaws = {}