Skip to content

Commit

Permalink
ACAS-783: Fix package import error and message printing
Browse files Browse the repository at this point in the history
  • Loading branch information
brianbolt committed Jun 26, 2024
1 parent 47f8661 commit 6824639
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 6824639

Please sign in to comment.