Skip to content

Commit

Permalink
Merge pull request #1183 from mcneilco/ACAS-783
Browse files Browse the repository at this point in the history
ACAS-783: Fix package import error and message printing
  • Loading branch information
brianbolt authored Jun 26, 2024
2 parents 47f8661 + 6824639 commit cc7bbb5
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,20 @@
import ldclient
from ldclient.client import LDClient, LiveReport

### Generic helper functions
def eprint(*args, **kwargs):
"""Print to stderr"""
print(*args, file=sys.stderr, **kwargs)

try:
import requests
from requests.packages.urllib3.exceptions import (InsecurePlatformWarning,
InsecureRequestWarning,
SNIMissingWarning)
InsecureRequestWarning)
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
requests.packages.urllib3.disable_warnings(InsecurePlatformWarning)
requests.packages.urllib3.disable_warnings(SNIMissingWarning)
except ImportError:
except ImportError as e:
#ignore error, allow warnings
print('ignoring ImportError')

### Generic helper functions
def eprint(*args, **kwargs):
"""Print to stderr"""
print(*args, file=sys.stderr, **kwargs)
eprint(f"Ignoring ImportError: {e}")

def str2bool(v):
if isinstance(v, bool):
Expand Down

0 comments on commit cc7bbb5

Please sign in to comment.