From 6929eb67375cc5088fd1cb8e738cd60f1b02b350 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Tue, 11 Feb 2020 15:33:39 -0700 Subject: [PATCH] Defer pycurl import until it is needed --- geomagio/Util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/geomagio/Util.py b/geomagio/Util.py index a26ff8f9..1c90dc8e 100644 --- a/geomagio/Util.py +++ b/geomagio/Util.py @@ -1,4 +1,3 @@ -import pycurl import numpy import os from obspy.core import Stats, Trace @@ -160,6 +159,8 @@ def read_url(url, connect_timeout=15, max_redirects=5, timeout=300): raise e except Exception: pass + # wait to import pycurl until it is needed + import pycurl content = None out = BytesIO() curl = pycurl.Curl() -- GitLab