Skip to content

Commit a686399

Browse files
authored
ref: Move type check to python isinstance (#19)
1 parent ae5d4c4 commit a686399

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/AppTokenPythonExample.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
REQUEST_TIMEOUT = 60
1414
# Please don't forget to change token and secret key values to production ones when switching to production
1515

16+
1617
def create_applicant(external_user_id, level_name):
1718
# https://docs.sumsub.com/reference/create-applicant
1819
body = {'externalUserId': external_user_id}
@@ -88,7 +89,7 @@ def sign_request(request: requests.Request) -> requests.PreparedRequest:
8889
path_url = prepared_request.path_url # includes encoded query params
8990
# could be None so we use an empty **byte** string here
9091
body = b'' if prepared_request.body is None else prepared_request.body
91-
if type(body) == str:
92+
if isinstance(body, str):
9293
body = body.encode('utf-8')
9394
data_to_sign = str(now).encode('utf-8') + method.encode('utf-8') + path_url.encode('utf-8') + body
9495
# hmac needs bytes

0 commit comments

Comments
 (0)