From 2fe06b17ffecf8d348c17cb16a799ec05f373a2b Mon Sep 17 00:00:00 2001 From: Goutte Date: Fri, 14 Sep 2018 11:14:02 +0200 Subject: [PATCH] Move the ENV directives *before* the first try to import spacepy. --- web/run.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/run.py b/web/run.py index 677cd32..5117341 100755 --- a/web/run.py +++ b/web/run.py @@ -132,6 +132,12 @@ PARAMETERS = { } +# ENV ######################################################################### + +environ['SPACEPY'] = CACHE_DIR +environ['CDF_LIB'] = CDF_LIB + + # SETUP FLASK ENGINE ########################################################## app = Flask(__name__, root_path=THIS_DIRECTORY) @@ -896,8 +902,6 @@ def update_spacepy(): """ Importing pydcf will fail if the toolbox is not up to date. """ - environ['SPACEPY'] = CACHE_DIR - environ['CDF_LIB'] = CDF_LIB try: log.info("Updating spacepy's toolbox…") import spacepy.toolbox @@ -1233,6 +1237,9 @@ def download_targets_cdf(targets, inp, started_at, stopped_at): except ImportError as e: log.error("Failed to import pycdf from spacepy : %s" % e) raise + except Exception as e: + log.error("Failed to import pycdf from spacepy : %s" % e) + raise try: cdf_handle = pycdf.CDF(cdf_path, masterpath='') -- libgit2 0.21.2