From: Michael R. Crusoe <crusoe@debian.org>
Subject: cope with an invalid HTTP_PROXY
Forwarded: https://github.com/DataBiosphere/toil/pull/3447

Debian purposely sets an invalid HTTP_PROXY during some build situations
--- toil.orig/src/toil/jobStores/abstractJobStore.py
+++ toil/src/toil/jobStores/abstractJobStore.py
@@ -37,6 +37,10 @@
 
 logger = logging.getLogger(__name__)
 
+try:
+    from botocore.exceptions import ProxyConnectionError
+except ImportError:
+    ProxyConnectionError = None
 
 class InvalidImportExportUrlException(Exception):
     def __init__(self, url):
@@ -243,7 +247,7 @@
             from importlib import import_module
             try:
                 module = import_module(moduleName)
-            except ImportError:
+            except (ImportError, ProxyConnectionError):
                 logger.debug("Unable to import '%s' as is expected if the corresponding extra was "
                              "omitted at installation time.", moduleName)
             else:
