Skip to content

Commit ca8850d

Browse files
committed
add catch to get distribution
1 parent 7d97e5a commit ca8850d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

uid2_client/request_response_util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ def _make_url(base_url, path):
1212

1313

1414
def auth_headers(auth_key):
15+
try:
16+
version = pkg_resources.get_distribution("uid2_client").version
17+
except Exception:
18+
version = "0"
19+
1520
return {'Authorization': 'Bearer ' + auth_key,
16-
"X-UID2-Client-Version": "uid2-client-python-" + pkg_resources.get_distribution("uid2_client").version}
21+
"X-UID2-Client-Version": "uid2-client-python-" + version}
1722

1823

1924
def make_v2_request(secret_key, now, data=None):

0 commit comments

Comments
 (0)